| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 23 | public function canRenderResourcesFromPetStore() |
||
| 24 | { |
||
| 25 | $bundle = new PetStoreBundle(); |
||
| 26 | $document = SwaggerDocumentTest::getPetStoreDocument(); |
||
| 27 | $generator = new ResourceGenerator(); |
||
| 28 | $generator->setSkeletonDirs('src/Dev/Resources/skeleton'); |
||
|
|
|||
| 29 | $generator->generate($bundle, $document, 'Foo\Bar'); |
||
| 30 | $files = [ |
||
| 31 | 'User.php', |
||
| 32 | 'Category.php', |
||
| 33 | 'Pet.php', |
||
| 34 | 'Order.php', |
||
| 35 | ]; |
||
| 36 | |||
| 37 | foreach ($files as $file) { |
||
| 38 | $filePathName = $bundle->getPath() . '/Foo/Bar/' . $file; |
||
| 39 | $this->assertTrue( |
||
| 40 | file_exists($filePathName), |
||
| 41 | sprintf('%s has not been generated', $filePathName) |
||
| 42 | ); |
||
| 43 | $content = file_get_contents($filePathName); |
||
| 44 | $this->assertContains("namespace {$bundle->getNamespace()}\\Foo\\Bar;", $content); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: