Passed
Pull Request — master (#11)
by Simon
01:34
created

StripeSlackPageTest::testCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Firesphere\StripeSlack\Test;
4
5
use Firesphere\StripeSlack\Controller\StripeSlackPageController;
6
use Firesphere\StripeSlack\Form\SlackSignupForm;
7
use Firesphere\StripeSlack\Page\StripeSlackPage;
0 ignored issues
show
Bug introduced by
The type Firesphere\StripeSlack\Page\StripeSlackPage was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use SilverStripe\Dev\SapphireTest;
9
use SilverStripe\Forms\FieldList;
10
11
class StripeSlackPageTest extends SapphireTest
12
{
13
    public function testCMSFields()
14
    {
15
        $class = StripeSlackPage::create();
16
        $fields = $class->getCMSFields();
17
18
        $this->assertInstanceOf(FieldList::class, $fields);
19
    }
20
21
    public function testSlackSignupForm()
22
    {
23
        $this->assertInstanceOf(SlackSignupForm::class, StripeSlackPageController::create()->SlackSignupForm());
24
    }
25
26
    public function testSlackSignupFormSuccess()
27
    {
28
        $this->assertInstanceOf(StripeSlackPageController::class, StripeSlackPageController::create()->success());
29
    }
30
31
    public function testSlackSignupFormError()
32
    {
33
        $this->assertInstanceOf(StripeSlackPageController::class, StripeSlackPageController::create()->oops());
34
    }
35
}
36