getMock('Google_Service'); $this->getMock('Google_Model'); $this->getMock('Google_Collection'); $this->getMock('Google_Service_Resource'); } /** * @dataProvider serviceProvider */ public function testIncludes($class) { $this->assertTrue( class_exists($class), sprintf('Failed asserting class %s exists.', $class) ); } public function testCaseConflicts() { $apis = $this->apiProvider(); $classes = array_unique(array_map('strtolower', $apis)); $this->assertCount(count($apis), $classes); } public function serviceProvider() { $classes = array(); $path = __DIR__ . '/../src/Google/Service/'; foreach (glob($path . "*.php") as $file) { $service = basename($file, '.php'); $classes[] = array('Google_Service_' . $service); foreach (glob($path . "{$service}/*.php") as $file) { $classes[] = array("Google_Service_{$service}_" . basename($file, '.php')); } foreach (glob($path . "{$service}/Resource/*.php") as $file) { $classes[] = array("Google_Service_{$service}_Resource_" . basename($file, '.php')); } } return $classes; } public function apiProvider() { $classes = array(); $path = __DIR__ . '/../src/Google/Service/*'; return array_filter(glob($path), 'is_dir'); } }