for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dynamic\Foxy\Test\Extension;
use Dynamic\Foxy\Extension\Purchasable;
use Dynamic\Foxy\Model\Variation;
use Dynamic\Foxy\Test\TestOnly\TestProduct;
use Dynamic\Foxy\Test\TestOnly\TestShippableProduct;
use Dynamic\Foxy\Test\TestOnly\TestVariation;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Debug;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Forms\FieldList;
/**
* Class ShippableTest
* @package Dynamic\Foxy\Test\Extension
*/
class ShippableTest extends SapphireTest
{
* @var string
protected static $fixture_file = '../fixtures.yml';
* @var array
protected static $extra_dataobjects = [
TestProduct::class,
TestVariation::class,
];
* @var \string[][]
protected static $required_extensions = [
TestProduct::class => [
Purchasable::class,
],
*
public function setUp()
Config::modify()->set(TestVariation::class, 'has_one', ['Product' => TestProduct::class]);
return parent::setUp();
}
public function testUpdateCMSFields()
$object = Injector::inst()->create(TestShippableProduct::class);
$fields = $object->getCMSFields();
$this->assertInstanceOf(FieldList::class, $fields);