1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Symfony-Util package. |
5
|
|
|
* |
6
|
|
|
* (c) Jean-Bernard Addor |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
13
|
|
|
|
14
|
|
|
class DefaultControllerTest extends WebTestCase |
|
|
|
|
15
|
|
|
{ |
16
|
|
View Code Duplication |
public function testIndex() |
|
|
|
|
17
|
|
|
{ |
18
|
|
|
$this->markTestIncomplete(); // Test does not work any more with Symfony 3.4 |
19
|
|
|
|
20
|
|
|
$client = static::createClient(); |
21
|
|
|
|
22
|
|
|
$crawler = $client->request('GET', '/'); |
|
|
|
|
23
|
|
|
|
24
|
|
|
$this->assertSame( |
25
|
|
|
200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK, |
|
|
|
|
26
|
|
|
$client->getResponse()->getStatusCode() |
27
|
|
|
); |
28
|
|
|
|
29
|
|
|
$this->assertContains('Hello Component!', $client->getResponse()->getContent()); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
View Code Duplication |
public function testArgument() |
|
|
|
|
33
|
|
|
{ |
34
|
|
|
$this->markTestIncomplete(); // Test does not work any more with Symfony 3.4 |
35
|
|
|
|
36
|
|
|
$client = static::createClient(); |
37
|
|
|
|
38
|
|
|
$crawler = $client->request('GET', '/argument'); |
|
|
|
|
39
|
|
|
|
40
|
|
|
$this->assertSame( |
41
|
|
|
200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK, |
|
|
|
|
42
|
|
|
$client->getResponse()->getStatusCode() |
43
|
|
|
); |
44
|
|
|
|
45
|
|
|
$this->assertContains('Hello Component!', $client->getResponse()->getContent()); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
View Code Duplication |
public function testConstructor() |
|
|
|
|
49
|
|
|
{ |
50
|
|
|
$this->markTestIncomplete(); // Test does not work any more with Symfony 3.4 |
51
|
|
|
|
52
|
|
|
$client = static::createClient(); |
53
|
|
|
|
54
|
|
|
$crawler = $client->request('GET', '/constructor'); |
|
|
|
|
55
|
|
|
|
56
|
|
|
$this->assertSame( |
57
|
|
|
200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK, |
|
|
|
|
58
|
|
|
$client->getResponse()->getStatusCode() |
59
|
|
|
); |
60
|
|
|
|
61
|
|
|
$this->assertContains('Hello Component!', $client->getResponse()->getContent()); |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.