These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @package elemental |
||
5 | * @subpackage tests |
||
6 | */ |
||
7 | class ElementPageExtensionTests extends FunctionalTest { |
||
0 ignored issues
–
show
|
|||
8 | |||
9 | protected static $fixture_file = 'elemental/tests/fixtures.yml'; |
||
10 | |||
11 | public function setUp() { |
||
12 | parent::setUp(); |
||
13 | |||
14 | Page::add_extension('ElementPageExtension'); |
||
15 | } |
||
16 | |||
17 | public function testUpdateCmsFields() { |
||
18 | $page = $this->objFromFixture('Page', 'elementaldemo'); |
||
19 | |||
20 | $elementarea = $page->getCMSFields()->dataFieldByName('ElementArea'); |
||
21 | $this->assertNotNull($elementarea); |
||
0 ignored issues
–
show
The method
assertNotNull() does not seem to exist on object<ElementPageExtensionTests> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
22 | |||
23 | |||
24 | $content = $page->getCMSFields()->dataFieldByName('Content'); |
||
25 | $this->assertNull($content); |
||
0 ignored issues
–
show
The method
assertNull() does not seem to exist on object<ElementPageExtensionTests> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
26 | |||
27 | $redirect = $this->objFromFixture('RedirectorPage', 'elementredirectpage'); |
||
28 | $elementarea = $redirect->getCMSFields()->dataFieldByName('ElementArea'); |
||
29 | $this->assertNull($elementarea); |
||
0 ignored issues
–
show
The method
assertNull() does not seem to exist on object<ElementPageExtensionTests> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
30 | } |
||
31 | |||
32 | } |
||
33 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.