From 571f4b597a8af2a11c83c3e49f90bee3819cb49b Mon Sep 17 00:00:00 2001 From: mmyllynen <4696381+dire@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:13:21 +0200 Subject: [PATCH] Revert "Added tests for the new field." This reverts commit 30f4982b2b4538dc01c5607eb4e994a557057e5e. --- src/Fixture/Unit.php | 18 ------------ tests/src/Unit/ConnectionRepositoryTest.php | 2 -- tests/src/Unit/ConnectionTest.php | 31 --------------------- 3 files changed, 51 deletions(-) diff --git a/src/Fixture/Unit.php b/src/Fixture/Unit.php index ec3f8e2..8af98f1 100644 --- a/src/Fixture/Unit.php +++ b/src/Fixture/Unit.php @@ -690,24 +690,6 @@ public function getMockData() : array { 'www_en' => 'https://localhost/en', 'www_sv' => 'https://localhost/sv', ], - [ - 'unit_id' => 1, - 'section_type' => 'SUBGROUP', - 'name_fi' => 'subgroup fi 1', - 'name_en' => 'subgroup en 1', - 'name_sv' => 'subgroup sv 1', - 'contact_person' => 'subgroup contact person name', - 'phone' => '0406543210', - ], - [ - 'unit_id' => 1, - 'section_type' => 'SUBGROUP', - 'name_fi' => 'subgroup fi 2', - 'name_en' => 'subgroup en 2', - 'name_sv' => 'subgroup sv 2', - 'contact_person' => 'contact person name 2', - 'phone' => '0506543210', - ], ], 'provided_languages' => [ 'fi', diff --git a/tests/src/Unit/ConnectionRepositoryTest.php b/tests/src/Unit/ConnectionRepositoryTest.php index ba60c6d..33633aa 100644 --- a/tests/src/Unit/ConnectionRepositoryTest.php +++ b/tests/src/Unit/ConnectionRepositoryTest.php @@ -12,7 +12,6 @@ use Drupal\helfi_tpr\Field\Connection\PhoneOrEmail; use Drupal\helfi_tpr\Field\Connection\Price; use Drupal\helfi_tpr\Field\Connection\Repository; -use Drupal\helfi_tpr\Field\Connection\Subgroup; use Drupal\helfi_tpr\Field\Connection\Topical; use Drupal\Tests\UnitTestCase; @@ -75,7 +74,6 @@ public function getTestData() : array { [Price::TYPE_NAME], [PhoneOrEmail::TYPE_NAME], [Topical::TYPE_NAME], - [Subgroup::TYPE_NAME], ]; } diff --git a/tests/src/Unit/ConnectionTest.php b/tests/src/Unit/ConnectionTest.php index bb01a7a..51a37e1 100644 --- a/tests/src/Unit/ConnectionTest.php +++ b/tests/src/Unit/ConnectionTest.php @@ -11,7 +11,6 @@ use Drupal\helfi_tpr\Field\Connection\OtherInfo; use Drupal\helfi_tpr\Field\Connection\PhoneOrEmail; use Drupal\helfi_tpr\Field\Connection\Price; -use Drupal\helfi_tpr\Field\Connection\Subgroup; use Drupal\helfi_tpr\Field\Connection\TextWithLink; use Drupal\helfi_tpr\Field\Connection\Topical; @@ -199,36 +198,6 @@ public function testTopical() : void { $this->assertNotEmpty($object->build()); } - /** - * Tests subgroups. - * - * @covers \Drupal\helfi_tpr\Field\Connection\Subgroup::build - * @covers \Drupal\helfi_tpr\Field\Connection\Subgroup::getFields - * @covers ::set - * @covers ::get - * @covers ::isValidField - */ - public function testSubgroup() : void { - $object = new Subgroup(); - $object->set('name', 'Some information.'); - $this->assertNotEmpty($object->build()); - - // Make sure we can override data. - $object->set('name', 'override'); - $this->assertNotEmpty($object->build()); - - $this->assertEquals(['name', 'contact_person', 'phone', 'email'], $object->getFields()); - - $this->assertNull($object->get('www')); - - $object->set('contact_person', 'John Doe'); - $this->assertNotEmpty($object->build()); - $object->set('phone', '040123456'); - $this->assertNotEmpty($object->build()); - $object->set('email', 'john.doe@example.com'); - $this->assertNotEmpty($object->build()); - } - /** * Tests invalid field name. *