From 5c7f2f17f9c471d306955df457c7cab4e5c6ed3b Mon Sep 17 00:00:00 2001 From: Snap Date: Thu, 16 Apr 2015 14:51:26 -0700 Subject: Google's OpenID Connect method $google_client_id & $google_client_secret must be added to db.inc.php! --- .../tests/general/ServiceTest.php | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 includes/google-api-php-client-master/tests/general/ServiceTest.php (limited to 'includes/google-api-php-client-master/tests/general/ServiceTest.php') diff --git a/includes/google-api-php-client-master/tests/general/ServiceTest.php b/includes/google-api-php-client-master/tests/general/ServiceTest.php new file mode 100644 index 0000000..306c4a2 --- /dev/null +++ b/includes/google-api-php-client-master/tests/general/ServiceTest.php @@ -0,0 +1,106 @@ +mapTypes( + array( + 'name' => 'asdf', + 'gender' => 'z', + ) + ); + $this->assertEquals('asdf', $model->name); + $this->assertEquals('z', $model->gender); + $model->mapTypes( + array( + '__infoType' => 'Google_Model', + '__infoDataType' => 'map', + 'info' => array ( + 'location' => 'mars', + 'timezone' => 'mst', + ), + 'name' => 'asdf', + 'gender' => 'z', + ) + ); + $this->assertEquals('asdf', $model->name); + $this->assertEquals('z', $model->gender); + + $this->assertEquals(false, $model->isAssociativeArray("")); + $this->assertEquals(false, $model->isAssociativeArray(false)); + $this->assertEquals(false, $model->isAssociativeArray(null)); + $this->assertEquals(false, $model->isAssociativeArray(array())); + $this->assertEquals(false, $model->isAssociativeArray(array(1, 2))); + $this->assertEquals(false, $model->isAssociativeArray(array(1 => 2))); + + $this->assertEquals(true, $model->isAssociativeArray(array('test' => 'a'))); + $this->assertEquals(true, $model->isAssociativeArray(array("a", "b" => 2))); + } + + /** + * @dataProvider serviceProvider + */ + public function testIncludes($class) + { + $this->assertTrue( + class_exists($class), + sprintf('Failed asserting class %s exists.', $class) + ); + } + + public function serviceProvider() + { + $classes = array(); + $path = dirname(dirname(dirname(__FILE__))) . '/src/Google/Service'; + foreach (glob($path . "/*.php") as $file) { + $classes[] = array('Google_Service_' . basename($file, '.php')); + } + + return $classes; + } + + public function testStrLen() + { + $this->assertEquals(0, Google_Utils::getStrLen(null)); + $this->assertEquals(0, Google_Utils::getStrLen(false)); + $this->assertEquals(0, Google_Utils::getStrLen("")); + + $this->assertEquals(1, Google_Utils::getStrLen(" ")); + $this->assertEquals(2, Google_Utils::getStrLen(" 1")); + $this->assertEquals(7, Google_Utils::getStrLen("0a\\n\n\r\n")); + } +} -- cgit v1.2.3