Skip to content

Commit

Permalink
Remove deprecated test of internal attributes via assertAttributeEqua…
Browse files Browse the repository at this point in the history
…ls in constructor tests

I removed the tests completely because they just test that the constructor assigns the values to the internal properties. Nothing that should be cared about from the outside.

See sebastianbergmann/phpunit#3339 (comment)

It is seen as bad practice to test internal stuff of objects instead of the actual input and output of mathod calls.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
  • Loading branch information
MorrisJobke authored and backportbot[bot] committed Jul 23, 2020
1 parent c813a9e commit 72fc3ec
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
10 changes: 0 additions & 10 deletions tests/lib/Template/CSSResourceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ private function randomString() {
return sha1(uniqid(mt_rand(), true));
}

public function testConstructor() {
$locator = $this->cssResourceLocator();
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
$this->assertAttributeEquals([], 'resources', $locator);
}

public function testFindWithAppPathSymlink() {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();
Expand Down
11 changes: 0 additions & 11 deletions tests/lib/Template/JSResourceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ private function randomString() {
return sha1(uniqid(mt_rand(), true));
}


public function testConstructor() {
$locator = $this->jsResourceLocator();
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
$this->assertAttributeEquals([], 'resources', $locator);
}

public function testFindWithAppPathSymlink() {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();
Expand Down
11 changes: 0 additions & 11 deletions tests/lib/Template/ResourceLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ public function getResourceLocator($theme, $core_map, $party_map, $appsRoots) {
'', true, true, true, []);
}

public function testConstructor() {
$locator = $this->getResourceLocator('theme',
['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
$this->assertAttributeEquals([], 'resources', $locator);
}

public function testFind() {
$locator = $this->getResourceLocator('theme',
['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']);
Expand Down

0 comments on commit 72fc3ec

Please sign in to comment.