Esempio n. 1
0
 public function testIteration_noRewind()
 {
     $dir = new \r8\FileSys\Dir("/path/to/a/dir/that/isnt/real");
     try {
         $dir->current();
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Interaction $err) {
         $this->assertSame("Iteration has not been rewound", $err->getMessage());
     }
     $this->assertFalse($dir->valid());
     try {
         $dir->current();
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Interaction $err) {
         $this->assertSame("Iteration has not been rewound", $err->getMessage());
     }
     try {
         $dir->key();
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Interaction $err) {
         $this->assertSame("Iteration has not been rewound", $err->getMessage());
     }
     try {
         $dir->hasChildren();
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Interaction $err) {
         $this->assertSame("Iteration has not been rewound", $err->getMessage());
     }
     try {
         $dir->getChildren();
         $this->fail("An expected exception was not thrown");
     } catch (\r8\Exception\Interaction $err) {
         $this->assertSame("Iteration has not been rewound", $err->getMessage());
     }
 }