Skip to content

Commit

Permalink
Merge pull request #213 from tienvx/make-property-clearer
Browse files Browse the repository at this point in the history
Make property clearer
  • Loading branch information
tienvx committed Mar 25, 2019
2 parents 78ba358 + 84d2fef commit ec2199b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Command/GeneratePathCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$metaData = $input->getOption('meta-data');
$generator = $this->generatorManager->getGenerator($generatorName);
$subject = $this->subjectManager->createSubject($model);
$subject->setTesting(true);
$subject->setTestingModel(true);
$subject->setUp();
$workflow = $this->workflowRegistry->get($subject, $model);

Expand Down
12 changes: 6 additions & 6 deletions src/Subject/AbstractSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ abstract class AbstractSubject implements SubjectInterface
/**
* @var bool
*/
protected $testing = false;
protected $testingModel = false;

/**
* @var array
Expand All @@ -35,19 +35,19 @@ abstract class AbstractSubject implements SubjectInterface
protected $screenshotsDir = '';

/**
* @param $testing boolean
* @param $testingModel bool
*/
public function setTesting(bool $testing = false)
public function setTestingModel(bool $testingModel = false)
{
$this->testing = $testing;
$this->testingModel = $testingModel;
}

/**
* @return bool
*/
public function isTesting()
public function isTestingModel()
{
return $this->testing;
return $this->testingModel;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/app/src/Subject/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function registerAndAddBillingAddress()
{
$this->registerAccount = false;
$this->loggedIn = true;
if (!$this->testing) {
if (!$this->testingModel) {
throw new Exception('Still able to do register account, guest checkout or login when logged in!');
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/app/src/Subject/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static function support(): string
*/
public function selectFile()
{
if (!$this->testing) {
if (!$this->testingModel) {
throw new Exception('Can not upload file!');
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/app/src/Subject/ShoppingCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public function addFromHome()
throw new Exception('Can not add product from home: product is not selected');
}
$product = $this->data['product'];
if (!$this->testing) {
if (!$this->testingModel) {
if (in_array($product, $this->needOptions)) {
throw new Exception('You need to specify options for this product! Can not add product');
}
Expand All @@ -377,7 +377,7 @@ public function addFromCategory()
throw new Exception('Can not add product from category: product is not selected');
}
$product = $this->data['product'];
if (!$this->testing) {
if (!$this->testingModel) {
if (in_array($product, $this->needOptions)) {
throw new Exception('You need to specify options for this product! Can not add product');
}
Expand All @@ -394,7 +394,7 @@ public function addFromCategory()
*/
public function addFromProduct()
{
if (!$this->testing) {
if (!$this->testingModel) {
if (in_array($this->product, $this->needOptions)) {
throw new Exception('You need to specify options for this product! Can not add product');
}
Expand Down Expand Up @@ -453,7 +453,7 @@ public function cart()
*/
public function checkout()
{
if (!$this->testing) {
if (!$this->testingModel) {
foreach ($this->cart as $product => $quantity) {
if (in_array($product, $this->outOfStock)) {
throw new Exception('You added an out-of-stock product into cart! Can not checkout');
Expand Down

0 comments on commit ec2199b

Please sign in to comment.