Completed
Push — master ( 59c799...149ad0 )
by Will
02:15
created

tests/ElementPageExtensionTests.php (4 issues)

Upgrade to new PHP Analysis Engine

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
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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
        $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.

Loading history...
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.

Loading history...
30
    }
31
32
}
33