From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- .../Zend/Gdata/Analytics/AccountQueryTest.php | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php (limited to 'zend/tests/Zend/Gdata/Analytics/AccountQueryTest.php') 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 @@ +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 + ); + } +} -- cgit v1.2.3