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.
Loading history...
|
|||
22 | |||
23 | |||
24 | $elementarea = $page->getCMSFields()->dataFieldByName('Content'); |
||
0 ignored issues
–
show
$elementarea is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the
Loading history...
|
|||
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.
Loading history...
|
|||
26 | |||
27 | $redirect = $this->objFromFixture('Page', 'elementredirectpage'); |
||
0 ignored issues
–
show
$redirect is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the
Loading history...
|
|||
28 | $elementarea = $page->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.
Loading history...
|
|||
30 | } |
||
31 | |||
32 | public function testDuplicatePageCopiesContent() { |
||
33 | |||
34 | } |
||
35 | |||
36 | public function testPublishingPagePublishesElement() { |
||
37 | |||
38 | } |
||
39 | |||
40 | public function testElementalArea() { |
||
41 | |||
42 | } |
||
43 | } |
||
44 |
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.