Exemplo n.º 1
0
    /**
     * Test the get of a container
     *
     * @return void
     */
    public function testGetContainer()
    {
        $this->_files->getHttpClient()
                    ->setAdapter($this->_httpClientAdapterTest);

        $this->_httpClientAdapterTest->setResponse($this->_loadResponse('../../_files/testAuthenticate'));
        $this->assertTrue($this->_files->authenticate(),'Authentication failed');

        $this->_httpClientAdapterTest->setResponse($this->_loadResponse(__FUNCTION__));

        $container= $this->_files->getContainer('foo');
        $this->assertTrue($this->_files->isSuccessful(),'Get container failed');
        $this->assertEquals($container->getName(),'foo','The name of container is wrong');
        $this->assertEquals($container->getSize(),9756,'The size in bytes is wrong');
        $this->assertEquals($container->getObjectCount(),2,'The objects count is wrong');
        $metadata= array(
            'foo' => 'bar',
            'foo2' => 'bar2'
        );
        $this->assertEquals($container->getMetadata(),$metadata,'The metadata is wrong');
    }
Exemplo n.º 2
0
 public function testGetContainer()
 {
     $container = $this->rackspace->getContainer(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME);
     $this->assertTrue($container !== false);
     $this->assertEquals($container->getName(), TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME);
 }