本文整理汇总了PHP中Object::build方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::build方法的具体用法?PHP Object::build怎么用?PHP Object::build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object
的用法示例。
在下文中一共展示了Object::build方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_schemaUpdate
/**
* 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: test_composerselfupdate
/**
* 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: convertToAgendorObject
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: test_defaults
/**
* 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: createDI
/**
* 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: test_build
/**
* 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: test_clone
/**
* 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: test_verbose
/**
* 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: setUp
/**
* 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');
}