Completed
Pull Request — master (#7)
by Jason
12:37
created

FoxyStripeInventoryManagerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFoxyStripePurchaseForm() 0 5 1
A testUpdateCMSFields() 0 6 1
1
<?php
2
3
namespace Dynamic\FoxyStripe\Test;
4
5
use Dynamic\FoxyStripe\Test\TestProduct;
6
use SilverStripe\Forms\FieldList;
7
8
class FoxyStripeInventoryManagerTest extends FoxyStripeInventoryTest
9
{
10
    /**
11
     *
12
     */
13
    public function testUpdateCMSFields()
14
    {
15
        $object = $this->objFromFixture(TestProduct::class, 'one');
16
        $fields = $object->getCMSFields();
17
        $this->assertInstanceOf(FieldList::class, $fields);
18
        $this->assertNotNull($fields->dataFieldByName('ControlInventory'));
19
    }
20
21
    /**
22
     *
23
     */
24
    public function testFoxyStripePurchaseForm()
25
    {
26
        $object = $this->objFromFixture(TestProduct::class, 'one');
27
        $controller = new TestProduct_Controller($object);
28
        $this->assertFalse($controller->PurchaseForm());
0 ignored issues
show
Bug introduced by
$controller->PurchaseForm() of type Dynamic\FoxyStripe\Form\FoxyStripePurchaseForm is incompatible with the type boolean expected by parameter $condition of PHPUnit_Framework_Assert::assertFalse(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
        $this->assertFalse(/** @scrutinizer ignore-type */ $controller->PurchaseForm());
Loading history...
29
    }
30
}