Completed
Push — master ( e69f36...e99b85 )
by Franco
11s
created

DMSDocumentAdminExtensionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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
Bug introduced by
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
Bug introduced by
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