fkooman\RemoteStorage\RemoteStorageTest::testGetFolderWithFolder PHP Méthode

testGetFolderWithFolder() public méthode

    public function testGetFolderWithFolder()
    {
        $p1 = new Path('/admin/messages/foo/baz.txt');
        $p2 = new Path('/admin/messages/foo/foobar/bar.txt');
        $p3 = new Path('/admin/messages/foo/');
        $this->r->putDocument($p1, 'text/plain', 'Hello Baz!');
        $this->r->putDocument($p2, 'text/plain', 'Hello Bar!');
        $this->r->putDocument($p2, 'text/plain', 'Hello Updated Bar!');
        $j = new Json();
        $folderData = $j->decode($this->r->getFolder($p3));
        $this->assertEquals(2, count($folderData));
        $this->assertEquals(2, count($folderData['items']));
        $this->assertEquals('http://remotestorage.io/spec/folder-description', $folderData['@context']);
        $this->assertRegexp('/2:[a-z0-9]+/i', $folderData['items']['foobar/']['ETag']);
        $this->assertRegexp('/1:[a-z0-9]+/i', $folderData['items']['baz.txt']['ETag']);
        $this->assertEquals('text/plain', $folderData['items']['baz.txt']['Content-Type']);
        $this->assertEquals(10, $folderData['items']['baz.txt']['Content-Length']);
        $this->assertRegexp('/3:[a-z0-9]+/i', $this->r->getVersion($p3));
    }