/** * @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(); }
public function testHardlink() { $file1 = new TempFile(); $path = $file1->getPath() . '-hardlink'; $file1->createHardLink($path); $file1->setContent('foo'); $file2 = new File($path); $this->assertSame('foo', $file2->getContent()); $file1->append('bar'); $this->assertSame('foobar', $file2->getContent()); }