Example #1
0
 /**
  * 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());
 }
Example #2
0
 /**
  * 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());
 }
Example #3
0
 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;
         }
     }
 }
Example #4
0
 /**
  * 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());
 }
Example #5
0
 /**
  * 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();
 }
Example #6
0
 /**
  * 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());
 }
Example #7
0
 /**
  * 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());
 }
Example #8
0
 /**
  * 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());
 }
Example #9
0
 /**
  * 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');
 }