Skip to content

Commit

Permalink
Add strict mode test
Browse files Browse the repository at this point in the history
  • Loading branch information
JaZo committed Oct 5, 2018
1 parent e0811e5 commit 8881798
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/ResponseBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@ public function getResponses(): array
];
}

/**
* @test
*/
public function it_can_be_set_to_strict_mode()
{
$builder = $this->getBuilder();

// Strict mode off
$this->assertFalse($builder->useStrictMode());

$messageFactory = MessageFactoryDiscovery::find();
$builder->build($messageFactory->createRequest('POST', 'http://example.com/api/articles?foo=bar'));

// Strict mode on
$builder->setStrictMode(true);
$this->assertTrue($builder->useStrictMode());

$this->expectException(MockNotFoundException::class);

$messageFactory = MessageFactoryDiscovery::find();
$builder->build($messageFactory->createRequest('POST', 'http://example.com/api/articles?foo=bar'));
}

/**
* @test
*/
Expand Down

0 comments on commit 8881798

Please sign in to comment.