Пример #1
0
        function _PicasaTests()
        {
            $picasa = new Picasa();
			// Try login to system
			$login = $picasa->Authenticate("dicsydel", "GhNjkdFtg4", "lh2");
			$this->assertTrue($login, "Success login to google system");
			
			if ($login)
			{
    			$picasa->Username = "******";
    			
    			$res = $picasa->GetUserInfo();
    			$this->assertTrue($res["username"], "User info received");
    			if (!$res)
    			     print $picasa->GetLastWarning()."<br>";
    			
    		    $res = $picasa->GetAlbums();
    		    
    		    var_dump($res[0]);
    		    
    			$this->assertTrue(is_array($res), "Albums list received");
    			if (!$res)
    			     print $picasa->GetLastWarning()."<br>";
    			     
    			$res = $picasa->EditPhoto($res[0]['photos'][0]["id"], $res[0]['id'], $res[0]['photos'][0]["version"], "test123");
    			$this->assertTrue($res, "Photo metadata updated");
    			if (!$res)
    			     print $picasa->GetLastWarning()."<br>";
			}
        }