本文整理汇总了PHP中TestHelper::getPrivateProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHelper::getPrivateProperty方法的具体用法?PHP TestHelper::getPrivateProperty怎么用?PHP TestHelper::getPrivateProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper
的用法示例。
在下文中一共展示了TestHelper::getPrivateProperty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: constructor
/**
* @test
*/
public function constructor()
{
$expressions = TestHelper::getPrivateProperty($this->where, 'expressions');
$this->assertInstanceOf('\\Ackintosh\\Higher\\Query\\Expression\\ExpressionUnit', $expressions[0], '-> sets "ExpressionUnit" object.');
$this->assertSame('AND', $expressions[1], '-> sets string.');
$this->assertInstanceOf('\\Ackintosh\\Higher\\Query\\Expression\\ExpressionUnit', $expressions[2], '-> sets "ExpressionUnit" object.');
}
示例2: setValue
/**
* @test
*/
public function setValue()
{
$value = 'testvalue';
$column = new Column($this->name, $this->type, $this->option);
$column->setValue($value);
$this->assertSame($value, TestHelper::getPrivateProperty($column, 'value'));
}
示例3: constructorSetsProperties
/**
* @test
*/
public function constructorSetsProperties()
{
$join = new Join($this->t1, $this->t2, $this->on);
$this->assertSame($this->t1, TestHelper::getPrivateProperty($join, 'owner'));
$this->assertSame($this->t2, TestHelper::getPrivateProperty($join, 'target'));
$this->assertSame($this->on, TestHelper::getPrivateProperty($join, 'on'));
}
示例4: constructor
/**
* @test
*/
public function constructor()
{
$str = 'foo';
$val = [1, 2, 3];
$sql = new Sql($str, $val);
$this->assertSame($str, TestHelper::getPrivateProperty($sql, 'sql'), '-> sets string to its "sql" property.');
$this->assertSame($val, TestHelper::getPrivateProperty($sql, 'values'), '-> sets array to its "values" property.');
}
示例5: set
/**
* @test
*/
public function set()
{
$table = new Table();
$update = new Update($table);
$params = ['foo' => 123, 'bar' => 456];
$update->set($params);
$this->assertInstanceOf('\\Ackintosh\\Higher\\Query\\Set', TestHelper::getPrivateProperty($update, 'set'), '-> sets "Set" object to "set" property.');
}
示例6: OrHasOR
/**
* @test
*/
public function OrHasOR()
{
$table = new Table();
$params[0] = '';
$params[1] = '';
$params[2] = '';
$expression = new Orx($table, $params);
$this->assertSame('OR', TestHelper::getPrivateProperty($expression, 'pre'));
}
示例7: valuesSetsProperty
/**
* @test
*/
public function valuesSetsProperty()
{
$table = new Table();
$columns = ['test1', 'test2'];
$upsert = new Upsert($table, $columns);
$values = ['value1', 'value2'];
$upsert->values($values);
$this->assertSame($values, TestHelper::getPrivateProperty($upsert, 'values'));
}
示例8: setColumns
/**
* @test
*/
public function setColumns()
{
$table = new Table();
$schema = ['id' => ['int', 'sequence'], 'name' => ['varchar'], 'created' => ['datetime']];
$record = new Record($table);
$record->setColumns($schema);
$columns = TestHelper::getPrivateProperty($record, 'columns');
$this->assertSame(count($schema), count($columns), '-> sets number of columns the same as the schema information.');
$this->assertSame(array_keys($schema), $record->getColumnNames(), '-> sets the column that has been defined in schema information.');
}
示例9: joinPushesJoinObjecttoProperty
/**
* @test
*/
public function joinPushesJoinObjecttoProperty()
{
$table = new Table();
$columns = ['col1', 'col2'];
$select = new Select($columns);
$select->from($table);
$table2 = new Table();
$select->join($table2, ['on1' => 'on2']);
$joins = TestHelper::getPrivateProperty($select, 'joins');
$this->assertInstanceOf('Ackintosh\\Higher\\Query\\Join', array_pop($joins));
}
示例10: constructorSetsProperties
/**
* @test
*/
public function constructorSetsProperties()
{
$table = new Table();
$params[0] = 'testcolumn';
$params[1] = 'testexpr';
$params[2] = 'testvlaue';
$expression = new Andx($table, $params);
$this->assertSame($table, TestHelper::getPrivateProperty($expression, 'table'));
$this->assertSame($params[0], TestHelper::getPrivateProperty($expression, 'column'));
$this->assertSame($params[1], TestHelper::getPrivateProperty($expression, 'expr'));
$this->assertSame($params[2], TestHelper::getPrivateProperty($expression, 'value'));
}
示例11: _orAddsObjectToProperty
/**
* @test
*/
public function _orAddsObjectToProperty()
{
$this->unit->_or(new Table(), [0, 0, 0]);
$exprs = TestHelper::getPrivateProperty($this->unit, 'exprs');
$this->assertInstanceOf('Ackintosh\\Higher\\Query\\Expression\\Orx', array_pop($exprs));
}
示例12: constructor
/**
* @test
*/
public function constructor()
{
$params = ['foo' => 123, 'bar' => 456];
$set = new Set($params);
$this->assertSame($params, TestHelper::getPrivateProperty($set, 'params'), '-> sets the params to "params" property.');
}