Kraken\_Module\Filesystem\_Partial\Filesystem\FsApiPrependPartial::testApiPrepend_PrependsToFile_WhenNodeIsFile PHP Method

testApiPrepend_PrependsToFile_WhenNodeIsFile() public method

    public function testApiPrepend_PrependsToFile_WhenNodeIsFile()
    {
        $test = $this->getTest();
        $fs = $this->createFilesystem();
        $dest = $this->getPrefixed('FILE_A');
        $before = 'FILE_A_TEXT';
        $after = 'FILE_A_NEW_TEXT';
        $test->assertTrue($fs->exists($dest));
        $test->assertSame($before, $fs->read($dest));
        $fs->prepend($dest, $after);
        $test->assertTrue($fs->exists($dest));
        $test->assertSame($after . $before, $fs->read($dest));
    }