コード例 #1
0
 public function testNextFailsIfFileNotFound()
 {
     $iterator = new RecursivePathsIterator(new ArrayIterator(array($this->tempDir . '/css', $this->tempDir . '/foo')), '/app');
     $iterator->rewind();
     $this->assertSame($this->tempDir . '/css', $iterator->key());
     $this->assertSame('/app', $iterator->current());
     try {
         $iterator->next();
         $this->fail('Expected a RuntimeException');
     } catch (RuntimeException $e) {
     }
     $this->assertFalse($iterator->valid());
     $this->assertNull($iterator->current());
     $this->assertNull($iterator->key());
 }