Skip to content

Commit

Permalink
Use ConcreteAssert. See #2.
Browse files Browse the repository at this point in the history
It saves having to type the PHPUnit class out each time and I can store it as an object in a property.
  • Loading branch information
john-arcus committed Apr 26, 2018
1 parent 64497a2 commit b7ce5c7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"require-dev": {
"behat/behat": "^3.4",
"phpunit/phpunit": "^7.1"
"phpunit/phpunit": "^7.1",
"arcus-software/concrete-php-assert": "^0.0.3"
}
}
33 changes: 32 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;

use PHPUnit\Framework\Assert;
use ConcretePhpAssert\ConcreteAssert;

/**
* Defines application features from the specific context.
Expand All @@ -23,7 +23,7 @@ class FeatureContext implements Context
*/
public function __construct()
{

$this->assert = new ConcreteAssert();
}

/**
Expand Down Expand Up @@ -69,7 +69,7 @@ public function iHaveVagrantAndAVirtualizationProductInstalledOnMyHostMachine()

//check for some virtualization product
//See: https://www.vagrantup.com/docs/providers/
PHPUnit\Framework\Assert::assertTrue( $this->isCliCommandSuccessful("VBoxManage --version") );
$this->assert->assertTrue( $this->isCliCommandSuccessful("VBoxManage --version") );

}

Expand Down Expand Up @@ -105,6 +105,6 @@ public function theExpectedOutputIsWrittenToStdoutToProveThatTheProjectCodeIsWor
//var_dump($this->latestConsoleOutputArray);


PHPUnit\Framework\Assert::assertEquals("Seems OK", $this->latestConsoleOutputArray[0]);
$this->assert->assertEquals("Seems OK", $this->latestConsoleOutputArray[0]);
}
}

0 comments on commit b7ce5c7

Please sign in to comment.