API endpoint for Timesheet entries (#332)

This commit is contained in:
Kevin Papst
2018-11-18 19:43:58 +01:00
committed by GitHub
parent 8cb52e22b1
commit b1c06eed7b
35 changed files with 1073 additions and 118 deletions

View File

@@ -82,11 +82,12 @@ abstract class ControllerBaseTest extends WebTestCase
* @param string $url
* @param string $method
* @param array $parameters
* @param string $content
* @return \Symfony\Component\DomCrawler\Crawler
*/
protected function request(Client $client, string $url, $method = 'GET', array $parameters = [])
protected function request(Client $client, string $url, $method = 'GET', array $parameters = [], string $content = null)
{
return $client->request($method, $this->createUrl($url), $parameters);
return $client->request($method, $this->createUrl($url), $parameters, [], [], $content);
}
/**

View File

@@ -39,6 +39,14 @@ class HelpControllerTest extends ControllerBaseTest
$this->assertContains('<a href="/en/help/">Back</a>', $client->getResponse()->getContent());
}
public function testMissingPage()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/help/foo');
$this->assertFalse($client->getResponse()->isSuccessful());
$this->assertEquals(404, $client->getResponse()->getStatusCode());
}
public function testValidateRouteDoesNotAllowSpecialChars()
{
$client = $this->getClientForAuthenticatedUser();