|
4 | 4 |
|
5 | 5 | class RssTest extends TestCase
|
6 | 6 | {
|
7 |
| - /** |
8 |
| - * @test |
9 |
| - */ |
10 |
| - public function it_registers_route() |
| 7 | + /** @test */ |
| 8 | + public function it_registers_routes_where_feeds_will_be_available() |
11 | 9 | {
|
12 | 10 | $this->assertEquals(200, $this->call('GET', '/en/myfeed')->getStatusCode());
|
13 | 11 | $this->assertEquals(200, $this->call('GET', '/nl/myfeed')->getStatusCode());
|
14 | 12 | }
|
15 | 13 |
|
16 |
| - /** |
17 |
| - * @test |
18 |
| - */ |
19 |
| - public function feed_has_all_models() |
| 14 | + /** @test */ |
| 15 | + public function a_feed_contains_meta_data() |
20 | 16 | {
|
21 | 17 | $content = $this->call('GET', '/en/myfeed')->getContent();
|
22 |
| - $this->assertEquals(5, substr_count($content, '<entry>')); |
23 |
| - } |
24 | 18 |
|
25 |
| - /** |
26 |
| - * @test |
27 |
| - * @dataProvider provider_feed_has_meta |
28 |
| - */ |
29 |
| - public function feed_has_meta($stringToCheck) |
30 |
| - { |
31 |
| - $content = $this->call('GET', '/en/myfeed')->getContent(); |
32 |
| - $this->assertTrue(str_contains($content, $stringToCheck)); |
| 19 | + $metaData = [ |
| 20 | + '<description>...</description>', |
| 21 | + '<link href="http://blender.192.168.10.10.xip.io/en/feed">', |
| 22 | + '<updated>', |
| 23 | + |
| 24 | + ]; |
| 25 | + |
| 26 | + foreach ($metaData as $metaDataItem) { |
| 27 | + $this->assertContains($metaDataItem, $content); |
| 28 | + } |
33 | 29 | }
|
34 | 30 |
|
35 |
| - /** |
36 |
| - * @dataProvider |
37 |
| - */ |
38 |
| - public function provider_feed_has_meta() : array |
| 31 | + /** @test */ |
| 32 | + public function a_feed_contains_all_selected_models() |
39 | 33 | {
|
40 |
| - return [ |
41 |
| - ['<description>...</description>'], |
42 |
| - ['<link href="http://blender.192.168.10.10.xip.io/en/feed">'], |
43 |
| - ['<updated>'], |
44 |
| - |
45 |
| - ]; |
| 34 | + $content = $this->call('GET', '/en/myfeed')->getContent(); |
| 35 | + $this->assertEquals(5, substr_count($content, '<entry>')); |
46 | 36 | }
|
47 | 37 | }
|
0 commit comments