예제 #1
0
    /**
     * Test the get of all the containers
     *
     * @return void
     */
    public function testGetContainers()
    {
        $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__));
        $containers= $this->_files->getContainers();
        $this->assertTrue($this->_files->isSuccessful(),'Get containers failed');
        $this->assertEquals($this->_files->getCountContainers(),3,'Total containers count is wrong');
        $this->assertEquals($this->_files->getSizeContainers(),27809,'Total objects size is wrong');
        $this->assertEquals($this->_files->getCountObjects(),6,'Total objects count is wrong');
        $this->assertEquals($containers[1]->getName(),'foo');
        $this->assertEquals($containers[1]->getObjectCount(),2);
        $this->assertEquals($containers[1]->getSize(),9756);
        $this->assertEquals($containers[2]->getName(),'test');
        $this->assertEquals($containers[2]->getObjectCount(),3);
        $this->assertEquals($containers[2]->getSize(),17839);
    }
예제 #2
0
 public function testGetCountContainers()
 {
     $num = $this->rackspace->getCountContainers();
     $this->assertTrue($num > 0);
 }