- Ma'am namespace spec\OrientExpress\Suspect; use PhpSpec\ObjectBehavior; use Prophecy\Argument; class SuspectSpec extends ObjectBehavior { function it_is_initializable() { $this->shouldHaveType('OrientExpress\Suspect\Suspect'); } }
- Ma'am namespace spec\OrientExpress\Suspect; use PhpSpec\ObjectBehavior; use Prophecy\Argument; class SuspectSpec extends ObjectBehavior { // ... function it_should_not_confess_to_wrong_questions_if_guilty() { $this->setGuilty(true); $this->answer('Are you the killer?') ->shouldReturn('Nope, not me'); } }
- Ma'am namespace spec\OrientExpress\Suspect; use PhpSpec\ObjectBehavior; use Prophecy\Argument; class SuspectSpec extends ObjectBehavior { // ... function it_should_confess_to_key_question_if_guilty() { $this->setGuilty(true); $this->answer('It was you!') ->shouldReturn('Mmmkay I confess'); } }
exist: | name | | "Murder on the Orient Express" | And the following detectives exist: | name | | "Herculse Poirot" | And the following suspects exist: | name | | "Princess Dragomiroff" | | "Count Adrenyi" |
"Murder on the Orient Express" was solved by "Hercules P oirot" And crime "Murder on the Orient Express" had suspects: | name | | "Princess Dragomiroff" | | "Count Adrenyi" | When I send GET request to "/api/crimes/ORIENT_EXPRESS_CRIME_ID" Then the response should contain json: """ { "crime": { "name": "Murder on the Orient Express", "detective": { "name": "Hercules Poirot" }, "suspects": [ { "name": "Princes Dragomiroff" }, { "name": "Count Adrenyi" } ] } } """