Completed
Push — master ( 87a4b0...824833 )
by
unknown
14s
created

tests/extensions/DMSDocumentAdminExtensionTest.php (3 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
class DMSDocumentAdminExtensionTest 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...
4
{
5
    protected $requiredExtensions = array(
6
        'DMSDocumentAdmin' => array('DMSDocumentAdminExtension')
7
    );
8
9
    public function setUp()
10
    {
11
        parent::setUp();
12
        $this->logInWithPermission('ADMIN');
13
    }
14
15
    /**
16
     * Ensure that the cart submission tab is available in the DMS model admin
17
     */
18
    public function testHasCartSubmissionsTab()
19
    {
20
        $response = $this->get('admin/documents');
21
        $this->assertEquals(200, $response->getStatusCode());
0 ignored issues
show
The method assertEquals() does not seem to exist on object<DMSDocumentAdminExtensionTest>.

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
        $this->assertContains('Cart Submission', (string) $response->getBody());
23
    }
24
25
    /**
26
     * Ensure that the "add new" button has been removed
27
     */
28
    public function testNoAddButtonInGridField()
29
    {
30
        $response = $this->get('admin/documents/DMSDocumentCartSubmission');
31
        $this->assertEquals(200, $response->getStatusCode());
0 ignored issues
show
The method assertEquals() does not seem to exist on object<DMSDocumentAdminExtensionTest>.

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...
32
        $this->assertNotContains('Add Cart Submission', (string) $response->getBody());
33
    }
34
}
35