103 |
- |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
4 |
* or more contributor license agreements. See the NOTICE file
|
|
|
5 |
* distributed with this work for additional information
|
|
|
6 |
* regarding copyright ownership. The ASF licenses this file
|
|
|
7 |
* to you under the Apache License, Version 2.0 (the
|
|
|
8 |
* "License"); you may not use this file except in compliance
|
|
|
9 |
* with the License. You may obtain a copy of the License at
|
|
|
10 |
*
|
|
|
11 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
12 |
*
|
|
|
13 |
* Unless required by applicable law or agreed to in writing,
|
|
|
14 |
* software distributed under the License is distributed on an
|
|
|
15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
16 |
* KIND, either express or implied. See the License for the
|
|
|
17 |
* specific language governing permissions and limitations
|
|
|
18 |
* under the License.
|
|
|
19 |
*/
|
|
|
20 |
|
|
|
21 |
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
22 |
|
|
|
23 |
class Google_Service_ServiceTest extends PHPUnit_Framework_TestCase
|
|
|
24 |
{
|
|
|
25 |
public function setUp()
|
|
|
26 |
{
|
|
|
27 |
// ensure dependent classes exist
|
|
|
28 |
$this->getMock('Google_Service');
|
|
|
29 |
$this->getMock('Google_Model');
|
|
|
30 |
$this->getMock('Google_Collection');
|
|
|
31 |
$this->getMock('Google_Service_Resource');
|
|
|
32 |
}
|
|
|
33 |
/**
|
|
|
34 |
* @dataProvider serviceProvider
|
|
|
35 |
*/
|
|
|
36 |
public function testIncludes($class)
|
|
|
37 |
{
|
|
|
38 |
$this->assertTrue(
|
|
|
39 |
class_exists($class),
|
|
|
40 |
sprintf('Failed asserting class %s exists.', $class)
|
|
|
41 |
);
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
public function serviceProvider()
|
|
|
45 |
{
|
|
|
46 |
$classes = array();
|
|
|
47 |
$path = __DIR__ . '/../src/Google/Service/';
|
|
|
48 |
foreach (glob($path . "*.php") as $file) {
|
|
|
49 |
$service = basename($file, '.php');
|
|
|
50 |
$classes[] = array('Google_Service_' . $service);
|
|
|
51 |
foreach (glob($path . "{$service}/*.php") as $file) {
|
|
|
52 |
$classes[] = array("Google_Service_{$service}_" . basename($file, '.php'));
|
|
|
53 |
}
|
|
|
54 |
foreach (glob($path . "{$service}/Resource/*.php") as $file) {
|
|
|
55 |
$classes[] = array("Google_Service_{$service}_Resource_" . basename($file, '.php'));
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
return $classes;
|
|
|
60 |
}
|
|
|
61 |
}
|