Source of file ProductGroupTest.php
Size: 0,924 Bytes - Last Modified: 2021-12-23T10:39:35+00:00
/var/www/docs.ssmods.com/process/src/tests/Pages/ProductGroupTest.php
123456789101112131415161718192021222324252627282930313233343536 | <?php namespace Sunnysideup\Ecommerce\Tests; use SilverStripe\Dev\FunctionalTest; use Sunnysideup\Ecommerce\Pages\ProductGroup; /** * @internal * @coversNothing */ class ProductGroupTest extends FunctionalTest { protected static $fixture_file = 'fixtures.yml'; public function testIndex() { $group = $this->objFromFixture(ProductGroup::class, 'mountainbiking'); $response = $this->get($group->Link()); $this->assertSame(200, $response->getStatusCode()); } public function testGetProductGroupsFromAlsoShowProducts() { $group = $this->objFromFixture(ProductGroup::class, 'mountainbiking'); $related = $group->getProductGroupsFromAlsoShowProducts(); $this->assertSame(1, $related->count()); $this->assertListEquals([ 'Title' => 'Fox Sports', ], $related, 'Fox sports is a related group to mountain biking'); } } |