-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NTR: add cheap fixture product for live tests
- Loading branch information
1 parent
098b573
commit 743d800
Showing
8 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace MolliePayments\Fixtures\Product; | ||
|
||
use Basecom\FixturePlugin\Fixture; | ||
use Basecom\FixturePlugin\FixtureBag; | ||
use Basecom\FixturePlugin\FixtureHelper; | ||
use MolliePayments\Fixtures\Category\CategoryFixture; | ||
use MolliePayments\Fixtures\Product\Traits\ProductFixtureTrait; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository; | ||
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface; | ||
|
||
class CheapProducts extends Fixture | ||
{ | ||
use ProductFixtureTrait; | ||
|
||
/** | ||
* @var FixtureHelper | ||
*/ | ||
private $helper; | ||
|
||
/** | ||
* @var EntityRepository | ||
*/ | ||
private $repoProducts; | ||
|
||
|
||
/** | ||
* @param FixtureHelper $helper | ||
* @param EntityRepository $repoProducts | ||
*/ | ||
public function __construct(FixtureHelper $helper, EntityRepository $repoProducts) | ||
{ | ||
$this->helper = $helper; | ||
$this->repoProducts = $repoProducts; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function groups(): array | ||
{ | ||
return [ | ||
'mollie', | ||
'mollie-demodata', | ||
]; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function dependsOn(): array | ||
{ | ||
return [ | ||
CategoryFixture::class | ||
]; | ||
} | ||
|
||
|
||
/** | ||
* @param FixtureBag $bag | ||
* @return void | ||
*/ | ||
public function load(FixtureBag $bag): void | ||
{ | ||
$category = 'Cheap'; | ||
$image = 'tshirt-black.png'; | ||
$description = 'Mollie Product for testing purpose in development environment. You can use this cheap products for LIVE tests or other scenarios'; | ||
|
||
$this->createProduct('1d3eefdd2d22436385580e2fb43431b9', 'Cheap Mollie Shirt', 'MOL_CHEAP_1', $category, $description, 1, $image, true, [], $this->repoProducts, $this->helper); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters