PHP code example of docteurklein / test-double-bundle
1. Go to this page and download the library: Download docteurklein/test-double-bundle 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/ */
docteurklein / test-double-bundle example snippets
php
public function registerBundles()
{
$bundles = [
new \DocteurKlein\TestDoubleBundle,
// …
];
return $bundles;
}
php
$issue = new Issue('test');
$container->get('github_client.prophecy')->addIssue($issue)->willReturn(true);
php
class Domain implements Context
{
public function __construct($container)
{
$this->container = $container;
}
/**
* @Given a building in "maintenance mode"
*/
public function aBuildingInMaintenanceMode()
{
$this->building = new Building('BUILDING1337');
$this->building->putInMaintenanceMode();
}
/**
* @When its last unpaid invoice is being paid
*/
public function itsLastUnpaidInvoiceIsBeingPaid()
{
$this->container
->get('repo.invoices.prophecy')
->findOneByReference('UNPAID04')
->willReturn(Invoice::ownedBy($this->building))
;
$pay = $this->container->get('app.task.invoice.pay');
$pay('UNPAID04');
}
/**
* @Then it should be removed from maintenance mode
*/
public function itShouldBeRemovedFromMaintenanceMode()
{
$this->container
->get('http.client.prophecy')
->removeFromMaintenanceMode('BUILDING1337')
->shouldHaveBeenCalled()
;
$this->container->get('stub.prophet')->checkPredictions();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.