Last active
December 2, 2015 23:06
-
-
Save spolischook/69cc1622fd7a60ccb7b5 to your computer and use it in GitHub Desktop.
Get files test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function testGetFiles() | |
{ | |
$method = self::getMethod('getFiles'); | |
$command = new ImportLogsCommand(); | |
$files = $method->invokeArgs($command, [realpath(__DIR__.'/../..')]); | |
$this->assertContains(realpath(__DIR__.'/ImportLogsCommandTest.php'), $files); | |
$this->assertContains(realpath(__DIR__.'/../../AppBundle.php'), $files); | |
} | |
/** | |
* @param string $name Method name | |
* @return \ReflectionMethod | |
*/ | |
protected static function getMethod($name) { | |
$class = new \ReflectionClass('AppBundle\Command\ImportLogsCommand'); | |
$method = $class->getMethod($name); | |
$method->setAccessible(true); | |
return $method; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment