PHP code example of trismegiste / phpunit-assert-solid
1. Go to this page and download the library: Download trismegiste/phpunit-assert-solid library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
trismegiste / phpunit-assert-solid example snippets
class ProjectTest extends PHPUnit_Framework_TestCase
{
use \Trismegiste\SolidAssert\GoodPractice; // <= this adds my new assertions
// see examples/SimpleTest.php for a running example or below...
class SimpleTest extends PHPUnit_Framework_TestCase
{
use \Trismegiste\SolidAssert\GoodPractice; // inserts new assertions
public function testConcreteTypeHint()
{
// this one tests for loose-coupling :
$this->assertInterfaceHintedParameter('BadProject\Case1');
}
public function testHollywoodPrinciple()
{
// this one for Hollywood Principle :
$this->assertHollywoodPrinciple('BadProject\Case4');
}
// ...
}