for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\ProductCatalog\Test;
use Dynamic\ProductCatalog\Docs\CareCleaningDoc;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
class ProductDocDataExtensionTest extends SapphireTest
{
/**
* @var string
*/
protected static $fixture_file = 'fixtures.yml';
*
public function testGetProductsCt()
$object = $this->objFromFixture(CareCleaningDoc::class, 'one');
$this->assertEquals($object->getProductsCt(), 1);
}
public function testGetProductsList()
$this->assertEquals($object->getProductsList(), 'Product One');
public function testGetCMSFields()
$fields = $object->getCMSFields();
$this->assertInstanceOf(FieldList::class, $fields);
public function testLink()
$this->assertEquals($object->Link(), $object->Download()->URL);
public function testGetIsProductDoc()
$this->assertEquals($object->getIsProductDoc(), true);