public function testCanReadFile() { $this->setupFileService(); $path = 'test'; $fileName = 'test.txt'; $filePath = $path . DIRECTORY_SEPARATOR . $fileName; $file = $this->fs->load($filePath); $this->assertInternalType('resource', $file, 'Loading file did not return resource'); }
public function testCanUpdateFile() { $this->setupFileService($this->cfg); $data = self::TEST_BASE_PATH; $path = 'test'; $fileName = 'test.txt'; $this->fs->save($path, $fileName, $data); $success = $this->fs->update($path . DIRECTORY_SEPARATOR . $fileName, $data . '1'); $this->assertTrue($success, 'Unable to update file'); $res = $this->fs->load($path . DIRECTORY_SEPARATOR . $fileName); $this->assertEquals(self::TEST_BASE_PATH . '1', stream_get_contents($res), 'Updated file did not contain correct string'); }