예제 #1
0
 /**
  * @expectedException RuntimeException
  */
 public function testDoubleUnlink()
 {
     $file = new File('/tmp/phpunit_test_unlink');
     $this->assertFalse($file->exists());
     $file->setContent('foo 42 bar');
     $this->assertTrue($file->exists());
     $file->unlink();
     $this->assertFalse($file->exists());
     $file->unlink();
 }
예제 #2
0
 public function testDontAutoremoveIfSwapped()
 {
     $this->markTestSkipped('This test failed on travis');
     $file1 = new TempFile();
     $file1->setContent('foo');
     $this->assertTrue($file1->exists());
     $file2 = new File($file1->getPath());
     $file1->unlink();
     $this->assertFalse($file1->exists());
     $file2->setContent('bar');
     unset($file1);
     $this->assertTrue($file2->exists());
 }