1 | <?php |
||
23 | abstract class SimpleUseCaseTest extends UseCaseTest |
||
24 | { |
||
25 | /** |
||
26 | * Returns the namespace and path to the current function tests. |
||
27 | * |
||
28 | * This method has to be invoked from a subclass because it uses reflection |
||
29 | * on the calling class to find the test's location and namespace. |
||
30 | * |
||
31 | * @return array |
||
32 | * @throws BadMethodCallException If invoked directly on SimpleUseCaseTest. |
||
33 | */ |
||
34 | 1 | protected static function getTestInfo() |
|
35 | { |
||
36 | 1 | $class = get_called_class(); |
|
37 | 1 | if ($class === 'Axstrad\Bundle\UseCaseTestBundle\Test\SimpleUseCaseTest') { |
|
38 | throw new BadMethodCallException( |
||
39 | __METHOD__.' cannot be invoked directly, it must be invoked '. |
||
40 | ' by a subclass.' |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | 1 | $namespaceKey = '\\Tests\\Functional'; |
|
45 | 1 | $pathKey = str_replace('\\', DIRECTORY_SEPARATOR, $namespaceKey); |
|
46 | |||
47 | 1 | $r = new \ReflectionClass($class); |
|
48 | 1 | $namespace = explode($namespaceKey, $r->getNamespaceName()); |
|
49 | 1 | $path = explode($pathKey, $r->getFileName()); |
|
50 | |||
51 | return array( |
||
52 | 1 | 'namespace' => $namespace[0].$namespaceKey, |
|
53 | 1 | 'path' => $path[0].$pathKey |
|
54 | ); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | */ |
||
59 | 1 | protected static function getKernelClass() |
|
65 | |||
66 | /** |
||
67 | * Define this method to configure the OptionsResolver. |
||
68 | * |
||
69 | * @param OptionsResolverInterface $resolver |
||
70 | * @return void |
||
71 | */ |
||
72 | 1 | public static function configureKernelOptions(OptionsResolverInterface $resolver) |
|
96 | } |
||
97 |