Exemple #1
0
                    foreach ($suite->specs as $spec) {
                        $this->spec = $spec;
                        $this->formatter->beforeSpec($spec);
                        $spec->run();
                        $this->formatter->afterSpec($spec);
                    }
                    $this->formatter->afterSuite($suite);
                }
                $this->formatter->after();
            }
            */
        });
    });
    describe("run", function () {
        it("should call run on the current runner object", function ($scope, $spec) {
            $oldRunner = pecs\runner();
            $mockRunner = new MockRunner();
            pecs\runner($mockRunner);
            $spec->expect($mockRunner->runCalls)->to_be_empty();
            $formatter = new pecs\Formatter();
            pecs\run($formatter);
            pecs\run($formatter);
            $spec->expect($mockRunner->runCalls)->to_have_count(2);
            $spec->expect($mockRunner->runCalls[0])->to_have_count(1);
            $spec->expect($mockRunner->runCalls[1])->to_have_count(1);
            $spec->expect($mockRunner->runCalls[0][0])->to_be($formatter);
            $spec->expect($mockRunner->runCalls[1][0])->to_be($formatter);
            pecs\runner($oldRunner);
        });
    });
});
Exemple #2
0
<?php

require 'vendor/rstuven/pecs/lib/pecs.php';
require 'vendor/.composer/autoload.php';
require 'lib/probe.php';
require 'lib/provider.php';
// include the tests
require __DIR__ . '/probe.php';
require __DIR__ . '/provider.php';
// run them
pecs\run();