]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove deprecated test of internal attributes via assertAttributeEquals in constructo... 22058/head
authorMorris Jobke <hey@morrisjobke.de>
Thu, 23 Jul 2020 11:44:18 +0000 (13:44 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 30 Jul 2020 11:19:16 +0000 (13:19 +0200)
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 <hey@morrisjobke.de>
tests/lib/Template/CSSResourceLocatorTest.php
tests/lib/Template/JSResourceLocatorTest.php
tests/lib/Template/ResourceLocatorTest.php

index 7c9f3585038b09645826c00abc5ec27d8c1605d2..47f3347bb6f8bff52af6f84d2034fe3fb973d66e 100644 (file)
@@ -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(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
-               $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
-               $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
-       }
-
        public function testFindWithAppPathSymlink() {
                // First create new apps path, and a symlink to it
                $apps_dirname = $this->randomString();
index 38c5fc0eadd1a323b2f4d86b6e02863fd1029afa..e4c8a11820cffd77125741994d54c7257f740c91 100644 (file)
@@ -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(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
-               $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
-               $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
-       }
-
        public function testFindWithAppPathSymlink() {
                // First create new apps path, and a symlink to it
                $apps_dirname = $this->randomString();
index 90488071b4f098150aae5003246399ac7287a292..392d21ae2042f8b8c809c87f4824447f02f6adb2 100644 (file)
@@ -33,17 +33,6 @@ class ResourceLocatorTest extends \Test\TestCase {
                        '', true, true, true, array());
        }
 
-       public function testConstructor() {
-               $locator = $this->getResourceLocator('theme',
-                       array('core'=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
-               $this->assertAttributeEquals('theme', 'theme', $locator);
-               $this->assertAttributeEquals('core', 'serverroot', $locator);
-               $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
-               $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
-               $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
-       }
-
        public function testFind() {
                $locator = $this->getResourceLocator('theme',
                        array('core' => 'map'), array('3rd' => 'party'), array('foo' => 'bar'));