]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove deprecated test of internal attributes via assertAttributeEquals in constructo... 21972/head
authorMorris Jobke <hey@morrisjobke.de>
Thu, 23 Jul 2020 11:44:18 +0000 (13:44 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 23 Jul 2020 15:11:29 +0000 (17:11 +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 01f2285670e9db7d96d081a6d0e2b3bc971297b9..8c2a50e97ca2063c00e6675f89ab3e30b182e55c 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(['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();
index 0e6b217ec52fb0d3250912c080f024fc4aa2d5bf..3f5d157e7f539983e291dcf96112735e7e4b21eb 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(['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();
index f0fa8186686a800c16433cf2ee2d74fc92d7d45d..71f39a1179ee8985dbcc1a68c770310871daf90d 100644 (file)
@@ -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']);