Skip to content

Commit

Permalink
Revert "Added tests for the new field."
Browse files Browse the repository at this point in the history
This reverts commit 30f4982.
  • Loading branch information
dire committed Nov 13, 2023
1 parent 30f4982 commit 571f4b5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
18 changes: 0 additions & 18 deletions src/Fixture/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 0 additions & 2 deletions tests/src/Unit/ConnectionRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -75,7 +74,6 @@ public function getTestData() : array {
[Price::TYPE_NAME],
[PhoneOrEmail::TYPE_NAME],
[Topical::TYPE_NAME],
[Subgroup::TYPE_NAME],
];
}

Expand Down
31 changes: 0 additions & 31 deletions tests/src/Unit/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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', '[email protected]');
$this->assertNotEmpty($object->build());
}

/**
* Tests invalid field name.
*
Expand Down

0 comments on commit 571f4b5

Please sign in to comment.