Blame view

tests/UrlGeneratorTest.php 1.45 KB
e77200db5   nologostudio.ru   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  <?php
  
  namespace FootyRoom\Tests;
  
  use FootyRoom\Support\UrlGenerator;
  use FootyRoom\Repositories\PostRepository;
  
  class UrlGeneratorTest extends TestCase
  {
      public function setUp()
      {
          parent::setUp();
  
          $this->urlGenerator = $this->app->make(UrlGenerator::class);
          $this->postRepo = $this->app->make(PostRepository::class);
      }
  
      public function testMatchReview()
      {
          $url = $this->urlGenerator->fromPost(
              $this->postRepo->findById(14326)
          );
  
          $this->assertEquals(route('matchReview', [
              'id' => 6084,
              'slug' => 'leicester-city-vs-manchester-city',
          ]), $url);
      }
  
      public function testPage()
      {
          $url = $this->urlGenerator->fromPost(
              $this->postRepo->findById(70063)
          );
  
          $this->assertEquals(route('transferCenter'), $url);
      }
  
      public function testMatchPreview()
      {
          $url = $this->urlGenerator->fromPost(
              $this->postRepo->findById(61381)
          );
  
          $this->assertEquals(route('matchPreview', [
              'id' => 79888528,
              'slug' => 'parma-vs-ac-milan-preview',
          ]), $url);
      }
  
      public function testLemix()
      {
          $url = $this->urlGenerator->fromPost(
              $this->postRepo->findById(67319)
          );
  
          $this->assertEquals(route('lemixPost', [
              'id' => 67319,
              'slug' => 'top-10-goals-of-the-week-16032015',
          ]), $url);
      }
  }