コード例 #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());
 }
コード例 #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());
 }
コード例 #3
0
ファイル: Util.php プロジェクト: ivanwitzke/agendor-php
 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;
         }
     }
 }
コード例 #4
0
ファイル: ListProcessTest.php プロジェクト: danzabar/alice
 /**
  * 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());
 }
コード例 #5
0
ファイル: Environment.php プロジェクト: antoligy/Framework
 /**
  * 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();
 }
コード例 #6
0
ファイル: CronProcessTest.php プロジェクト: danzabar/alice
 /**
  * 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());
 }
コード例 #7
0
ファイル: GitProcessTest.php プロジェクト: danzabar/alice
 /**
  * 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());
 }
コード例 #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());
 }
コード例 #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');
 }