| @@ 39-47 (lines=9) @@ | ||
| 36 | $this->assertContains('1', $crawler->filter('.widget .tag-list a .badge')->eq(1)->text()); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function testShowArticle() |
|
| 40 | { |
|
| 41 | $client = static::createClient(); |
|
| 42 | ||
| 43 | $crawler = $client->request('GET', '/article/test_title'); |
|
| 44 | ||
| 45 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 46 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function testSortAuthor() |
|
| 50 | { |
|
| @@ 49-57 (lines=9) @@ | ||
| 46 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function testSortAuthor() |
|
| 50 | { |
|
| 51 | $client = static::createClient(); |
|
| 52 | ||
| 53 | $crawler = $client->request('GET', '/author/user_name'); |
|
| 54 | ||
| 55 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 56 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 57 | } |
|
| 58 | ||
| 59 | public function testSortCategory() |
|
| 60 | { |
|
| @@ 59-67 (lines=9) @@ | ||
| 56 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 57 | } |
|
| 58 | ||
| 59 | public function testSortCategory() |
|
| 60 | { |
|
| 61 | $client = static::createClient(); |
|
| 62 | ||
| 63 | $crawler = $client->request('GET', '/category/test_category'); |
|
| 64 | ||
| 65 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 66 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testSortTags() |
|
| 70 | { |
|
| @@ 69-77 (lines=9) @@ | ||
| 66 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 67 | } |
|
| 68 | ||
| 69 | public function testSortTags() |
|
| 70 | { |
|
| 71 | $client = static::createClient(); |
|
| 72 | ||
| 73 | $crawler = $client->request('GET', '/tag/news'); |
|
| 74 | ||
| 75 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 76 | $this->assertContains('Test title', $crawler->filter('h2 a')->text()); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testFormComment() |
|
| 80 | { |
|
| @@ 105-113 (lines=9) @@ | ||
| 102 | $this->assertContains('Text comment', $crawler->filter('.media-body p')->text()); |
|
| 103 | } |
|
| 104 | ||
| 105 | public function testSuccess() |
|
| 106 | { |
|
| 107 | $client = static::createClient(); |
|
| 108 | ||
| 109 | $crawler = $client->request('GET', '/success'); |
|
| 110 | ||
| 111 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 112 | $this->assertContains('Your data successfully saved.', $crawler->filter('.alert')->text()); |
|
| 113 | } |
|
| 114 | } |
|
| 115 | ||
| @@ 9-17 (lines=9) @@ | ||
| 6 | ||
| 7 | class DefaultControllerTest extends WebTestCase |
|
| 8 | { |
|
| 9 | public function testIndex() |
|
| 10 | { |
|
| 11 | $client = static::createClient(); |
|
| 12 | ||
| 13 | $crawler = $client->request('GET', '/helloSymfony'); |
|
| 14 | ||
| 15 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 16 | $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text()); |
|
| 17 | } |
|
| 18 | } |
|
| 19 | ||