/** * Test getting correct CMD for schema update * * @return void * @author Dan Cox */ public function test_schemaUpdate() { $p = $this->process->build(['command' => ''])->getProcess(); $this->assertEquals("'php' 'vendor/bin/doctrine'", $p->getCommandLine()); $p = $this->process->build(['force' => true])->getProcess(); $this->assertEquals("'php' 'vendor/bin/doctrine' 'orm:schema:update' '--force'", $p->getCommandLine()); }
/** * Test the self update command * * @return void * @author Dan Cox */ public function test_composerselfupdate() { $this->process->build(['directory' => __DIR__]); $p = $this->process->setArguments(array('self-update'))->getProcess(); $this->assertEquals(__DIR__, $p->getWorkingDirectory()); $this->assertEquals("'composer' 'self-update'", $p->getCommandLine()); }
public static function convertToAgendorObject($response) { $types = array('person' => 'Ivanwitzke\\Agendor\\People', 'deal' => 'Ivanwitzke\\Agendor\\Deal', 'organization' => 'Ivanwitzke\\Agendor\\Organization', 'task' => 'Ivanwitzke\\Agendor\\Task'); if (self::isList($response)) { $output = array(); foreach ($response as $j) { array_push($output, self::convertToAgendorObject($j)); } return $output; } else { if (is_array($response)) { $objectName = self::getObjectName($response); if (isset($objectName) && is_string($objectName) && isset($types[$objectName])) { $class = $types[$objectName]; } else { $class = 'Ivanwitzke\\Agendor\\Object'; } return Object::build($response, $class); } else { return $response; } } }
/** * Test setting the defaults * * @return void * @author Dan Cox */ public function test_defaults() { $this->process->build(); $process = $this->process->getProcess(); $this->assertEquals('/usr/bin', $process->getWorkingDirectory()); }
/** * Loads the DI with a specific Service File * Important to note that this function does not use the CACHED DI Container. * * @param String $serviceFile - the name of the service YAML file * @return void * @author Dan Cox */ public function createDI($serviceFile = 'core') { $this->DI->build()->load($serviceFile)->compile(); }
/** * Test building the process * * @return void * @author Dan Cox */ public function test_build() { $this->process->build(); $this->assertEquals("'crontab' '/tmp/crontab.txt'", $this->process->getProcess()->getCommandLine()); }
/** * Test an example command, in this case git clone * * @return void * @author Dan Cox */ public function test_clone() { $this->process->build(['directory' => __DIR__]); $p = $this->process->setArguments(['clone', 'http://'])->getProcess(); $this->assertEquals("'git' 'clone' 'http://'", $p->getCommandLine()); }
/** * Test that setting verbose argument enables output * * @return void * @author Dan Cox */ public function test_verbose() { $this->process->build(['directory' => __DIR__, 'verbose' => TRUE]); $p = $this->process->setArguments(['ls'])->getProcess(); $this->assertFalse($p->isOutputDisabled()); }
/** * Set up test env * * @return void * @author Dan Cox */ public function setUp() { // Set up a new DI; $this->DI = new DI(dirname(__DIR__)); $this->DI->build()->load('service'); }