From 761cdf9877be6d286f96e1f3eb4beab052b89baa Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 23 Jul 2020 13:44:18 +0200 Subject: [PATCH] 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 https://github.com/sebastianbergmann/phpunit/issues/3339#issuecomment-428843322 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 --- tests/lib/Template/CSSResourceLocatorTest.php | 10 ---------- tests/lib/Template/JSResourceLocatorTest.php | 11 ----------- tests/lib/Template/ResourceLocatorTest.php | 11 ----------- 3 files changed, 32 deletions(-) diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php index 01f2285670e..8c2a50e97ca 100644 --- a/tests/lib/Template/CSSResourceLocatorTest.php +++ b/tests/lib/Template/CSSResourceLocatorTest.php @@ -107,16 +107,6 @@ class CSSResourceLocatorTest extends \Test\TestCase { 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(); diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php index 0e6b217ec52..3f5d157e7f5 100644 --- a/tests/lib/Template/JSResourceLocatorTest.php +++ b/tests/lib/Template/JSResourceLocatorTest.php @@ -86,17 +86,6 @@ class JSResourceLocatorTest extends \Test\TestCase { 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(); diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php index f0fa8186686..71f39a1179e 100644 --- a/tests/lib/Template/ResourceLocatorTest.php +++ b/tests/lib/Template/ResourceLocatorTest.php @@ -33,17 +33,6 @@ class ResourceLocatorTest extends \Test\TestCase { '', 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']); -- 2.39.5