diff options
| author | Horus3 | 2014-02-24 16:42:14 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-24 16:42:14 +0100 |
| commit | 06f945f27840b53e57795dadbc38e76f7e11ab1c (patch) | |
| tree | 689d5c7f4ffa15460c7e90f47c6a7dd59ce4e8bd /zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php | |
| download | random-06f945f27840b53e57795dadbc38e76f7e11ab1c.tar.gz | |
init
Diffstat (limited to 'zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php')
| -rw-r--r-- | zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php b/zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php new file mode 100644 index 0000000..a98f48d --- /dev/null +++ b/zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php @@ -0,0 +1,126 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Analytics + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +require_once 'Zend/Gdata/Analytics.php'; + +/** + * @category Zend + * @package Zend_Gdata_Analytics + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Analytics + */ +class Zend_GData_Analytics_AccountQueryTest extends PHPUnit_Framework_TestCase +{ + /** + * @var Zend_GData_Analytics_AccountQuery + */ + public $accountQuery; + + public function setUp() + { + $this->accountQuery = new Zend_GData_Analytics_AccountQuery(); + $this->queryBase = Zend_GData_Analytics_AccountQuery::ANALYTICS_FEED_URI; + } + + public function testWebpropertiesAll() + { + $this->accountQuery->webproperties(); + $allQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/~all/webproperties', + $allQuery + ); + } + + public function testWebpropertiesSpecific() + { + $this->accountQuery->webproperties(12345678); + $specificQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/12345678/webproperties', + $specificQuery + ); + } + + public function testProfilesAll() + { + $this->accountQuery->profiles(); + $allQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/~all/webproperties/~all/profiles', + $allQuery + ); + } + + public function testProfilesSpecific() + { + $this->accountQuery->profiles('U-87654321-0', 87654321); + $specificQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/87654321/webproperties/U-87654321-0/profiles', + $specificQuery + ); + } + + public function testGoalsAll() + { + $this->accountQuery->goals(); + $allQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/~all/webproperties/~all/profiles/~all/goals', + $allQuery + ); + } + + public function testGoalsSpecific() + { + $this->accountQuery->goals(42, 'U-87654321-0', 87654321); + $specificQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/87654321/webproperties/U-87654321-0/profiles/42/goals', + $specificQuery + ); + } + + public function testChainedProperties() + { + $this->accountQuery + ->goals(42) + ->profiles('U-87654321-0') + ->webproperties(87654321); + $specificQuery = $this->accountQuery->getQueryUrl(); + + $this->assertEquals( + $this->queryBase . '/87654321/webproperties/U-87654321-0/profiles/42/goals', + $specificQuery + ); + } +} |
