Skip to content

Commit 761cdf9

Browse files
committed
Remove deprecated test of internal attributes via assertAttributeEquals 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>
1 parent 1339ea1 commit 761cdf9

3 files changed

Lines changed: 0 additions & 32 deletions

File tree

tests/lib/Template/CSSResourceLocatorTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,6 @@ private function randomString() {
107107
return sha1(uniqid(mt_rand(), true));
108108
}
109109

110-
public function testConstructor() {
111-
$locator = $this->cssResourceLocator();
112-
$this->assertAttributeEquals('theme', 'theme', $locator);
113-
$this->assertAttributeEquals('core', 'serverroot', $locator);
114-
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
115-
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
116-
$this->assertAttributeEquals('map', 'webroot', $locator);
117-
$this->assertAttributeEquals([], 'resources', $locator);
118-
}
119-
120110
public function testFindWithAppPathSymlink() {
121111
// First create new apps path, and a symlink to it
122112
$apps_dirname = $this->randomString();

tests/lib/Template/JSResourceLocatorTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ private function randomString() {
8686
return sha1(uniqid(mt_rand(), true));
8787
}
8888

89-
90-
public function testConstructor() {
91-
$locator = $this->jsResourceLocator();
92-
$this->assertAttributeEquals('theme', 'theme', $locator);
93-
$this->assertAttributeEquals('core', 'serverroot', $locator);
94-
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
95-
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
96-
$this->assertAttributeEquals('map', 'webroot', $locator);
97-
$this->assertAttributeEquals([], 'resources', $locator);
98-
}
99-
10089
public function testFindWithAppPathSymlink() {
10190
// First create new apps path, and a symlink to it
10291
$apps_dirname = $this->randomString();

tests/lib/Template/ResourceLocatorTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ public function getResourceLocator($theme, $core_map, $party_map, $appsRoots) {
3333
'', true, true, true, []);
3434
}
3535

36-
public function testConstructor() {
37-
$locator = $this->getResourceLocator('theme',
38-
['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
39-
$this->assertAttributeEquals('theme', 'theme', $locator);
40-
$this->assertAttributeEquals('core', 'serverroot', $locator);
41-
$this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
42-
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
43-
$this->assertAttributeEquals('map', 'webroot', $locator);
44-
$this->assertAttributeEquals([], 'resources', $locator);
45-
}
46-
4736
public function testFind() {
4837
$locator = $this->getResourceLocator('theme',
4938
['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']);

0 commit comments

Comments
 (0)