Blame view

sources/3rdparty/kriswallsmith/assetic/tests/Assetic/Test/Asset/GlobAssetTest.php 1.78 KB
6d9380f96   Cédric Dupont   Update sources OC...
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
  <?php
  
  /*
   * This file is part of the Assetic package, an OpenSky project.
   *
   * (c) 2010-2014 OpenSky Project Inc
   *
   * For the full copyright and license information, please view the LICENSE
   * file that was distributed with this source code.
   */
  
  namespace Assetic\Test\Asset;
  
  use Assetic\Asset\GlobAsset;
  
  class GlobAssetTest extends \PHPUnit_Framework_TestCase
  {
      public function testInterface()
      {
          $asset = new GlobAsset(__DIR__.'/*.php');
          $this->assertInstanceOf('Assetic\\Asset\\AssetInterface', $asset, 'Asset implements AssetInterface');
      }
  
      public function testIteration()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for iteration');
      }
  
      public function testRecursiveIteration()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $this->assertGreaterThan(0, iterator_count($assets), 'GlobAsset initializes for recursive iteration');
      }
  
      public function testGetLastModifiedType()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $this->assertInternalType('integer', $assets->getLastModified(), '->getLastModified() returns an integer');
      }
  
      public function testGetLastModifiedValue()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $this->assertLessThan(time(), $assets->getLastModified(), '->getLastModified() returns a file mtime');
      }
  
      public function testLoad()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $assets->load();
  
          $this->assertNotEmpty($assets->getContent(), '->load() loads contents');
      }
  
      public function testDump()
      {
          $assets = new GlobAsset(__DIR__.'/*.php');
          $this->assertNotEmpty($assets->dump(), '->dump() dumps contents');
      }
  }