Exemplo n.º 1
0
 /**
  * @param Assertion $assertion
  */
 public function __construct(Assertion $assertion = null)
 {
     if ($assertion === null) {
         $assertion = Leo::assertion();
     }
     $this->assertion = $assertion;
 }
Exemplo n.º 2
0
/**
 * Returns Leo's Assertion object and sets
 * the actual value on it. The returned Assertion can then
 * be used for extension and chainable assertions.
 *
 * @param  mixed     $actual
 * @return Assertion
 */
function expect($actual)
{
    $instance = Leo::instance();
    $assertion = $instance->getAssertion();
    return $assertion->setActual($actual);
}
Exemplo n.º 3
0
<?php

use Evenement\EventEmitterInterface;
use Peridot\Leo\HttpFoundation\LeoHttpFoundation;
use Peridot\Leo\Leo;
use Peridot\Plugin\Watcher\WatcherPlugin;
use Peridot\Reporter\CodeCoverageReporters;
use Peridot\Reporter\Dot\DotReporterPlugin;
use Peridot\Reporter\ListReporter\ListReporterPlugin;
return function (EventEmitterInterface $emitter) {
    $emitter->on('peridot.start', function (\Peridot\Console\Environment $environment) {
        $environment->getDefinition()->getArgument('path')->setDefault('specs');
    });
    $watcher = new WatcherPlugin($emitter);
    $dot = new DotReporterPlugin($emitter);
    $list = new ListReporterPlugin($emitter);
    $coverage = new CodeCoverageReporters($emitter);
    $coverage->register();
    Leo::assertion()->extend(new LeoHttpFoundation());
};