Skip to content

Commit cea8022

Browse files
committed
fix risky tests
1 parent 5526e9c commit cea8022

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Tests/EventListener/BodyListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class BodyListenerTest extends TestCase
3636
* @param string $contentType the request header content type
3737
* @param bool $throwExceptionOnUnsupportedContentType
3838
*
39-
* @dataProvider testOnKernelRequestDataProvider
39+
* @dataProvider onKernelRequestDataProvider
4040
*/
4141
public function testOnKernelRequest($decode, Request $request, $method, $expectedParameters, $contentType = null, $throwExceptionOnUnsupportedContentType = false)
4242
{
@@ -76,7 +76,7 @@ public function testOnKernelRequest($decode, Request $request, $method, $expecte
7676
$this->assertEquals($request->request->all(), $expectedParameters);
7777
}
7878

79-
public static function testOnKernelRequestDataProvider()
79+
public static function onKernelRequestDataProvider()
8080
{
8181
return [
8282
'Empty POST request' => [true, new Request([], [], [], [], [], [], ['foo']), 'POST', ['foo'], 'application/json'],

Tests/Functional/ConfigurationTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@ class ConfigurationTest extends WebTestCase
1818
{
1919
public function testDisabledTemplating()
2020
{
21-
$this->createClient(['test_case' => 'Templating']);
21+
$kernel = self::bootKernel(['test_case' => 'Templating']);
22+
$container = $kernel->getContainer();
23+
24+
$this->assertFalse($container->has('fos_rest.templating'));
2225
}
2326

2427
public function testToolbar()
2528
{
26-
$this->createClient(['test_case' => 'Configuration'])
27-
->request(
29+
$client = $this->createClient(['test_case' => 'Configuration']);
30+
$client->request(
2831
'GET',
2932
'/_profiler/empty/search/results?limit=10',
3033
[],
3134
[],
3235
['HTTP_Accept' => 'application/json']
3336
);
37+
38+
$this->assertSame('text/html; charset=UTF-8', $client->getResponse()->headers->get('Content-Type'));
3439
}
3540
}

Tests/Functional/ParamFetcherTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ public function testFileParamImageConstraintArrayException()
194194
public function testValidQueryParameter()
195195
{
196196
$this->client->request('POST', '/params?foz=val1');
197+
198+
$this->assertArraySubset(array('foz' => ''), $this->getData());
197199
}
198200

199201
public function testIncompatibleQueryParameter()

Tests/Functional/SerializerErrorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class SerializerErrorTest extends WebTestCase
2020
{
2121
/**
22-
* @dataProvider testCaseProvider
22+
* @dataProvider invalidFormJsonProvider
2323
*/
2424
public function testSerializeExceptionJson($testCase)
2525
{
@@ -88,7 +88,7 @@ public function serializeExceptionXmlProvider()
8888
}
8989

9090
/**
91-
* @dataProvider testCaseProvider
91+
* @dataProvider invalidFormJsonProvider
9292
*/
9393
public function testSerializeInvalidFormJson($testCase)
9494
{
@@ -98,7 +98,7 @@ public function testSerializeInvalidFormJson($testCase)
9898
$this->assertEquals('{"code":400,"message":"Validation Failed","errors":{"children":{"name":{"errors":["This value should not be blank."]}}}}', $client->getResponse()->getContent());
9999
}
100100

101-
public function testCaseProvider()
101+
public function invalidFormJsonProvider()
102102
{
103103
return [
104104
['Serializer'],

0 commit comments

Comments
 (0)