1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dynamic\Products\Test; |
4
|
|
|
|
5
|
|
|
use Dynamic\Products\Model\Brochure; |
6
|
|
|
use Dynamic\Products\Model\ProductDoc; |
|
|
|
|
7
|
|
|
use SilverStripe\Dev\SapphireTest; |
8
|
|
|
use SilverStripe\Forms\FieldList; |
9
|
|
|
|
10
|
|
|
class ProductFileDataExtensionTest extends SapphireTest |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var string |
14
|
|
|
*/ |
15
|
|
|
protected static $fixture_file = '../fixtures.yml'; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* |
19
|
|
|
*/ |
20
|
|
|
public function testGetProductsCt() |
21
|
|
|
{ |
22
|
|
|
$object = $this->objFromFixture(Brochure::class, 'one'); |
23
|
|
|
$this->assertEquals($object->getProductsCt(), 1); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* |
28
|
|
|
*/ |
29
|
|
|
public function testGetProductsList() |
30
|
|
|
{ |
31
|
|
|
$object = $this->objFromFixture(Brochure::class, 'one'); |
32
|
|
|
$this->assertEquals($object->getProductsList(), 'Product One'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* |
37
|
|
|
*/ |
38
|
|
|
public function testGetCMSFields() |
39
|
|
|
{ |
40
|
|
|
$object = $this->objFromFixture(Brochure::class, 'one'); |
41
|
|
|
$fields = $object->getCMSFields(); |
42
|
|
|
$this->assertInstanceOf(FieldList::class, $fields); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* |
47
|
|
|
*/ |
48
|
|
|
public function testLink() |
49
|
|
|
{ |
50
|
|
|
$object = $this->objFromFixture(Brochure::class, 'one'); |
51
|
|
|
$this->assertEquals($object->getLink(), $object->Download()->URL); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* |
56
|
|
|
*/ |
57
|
|
|
public function testGetIsProductDoc() |
58
|
|
|
{ |
59
|
|
|
$object = $this->objFromFixture(Brochure::class, 'one'); |
60
|
|
|
$this->assertEquals($object->getIsProductFile(), true); |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths