コード例 #1
0
 public function testGetIncludedColumn()
 {
     $model = m::mock(array('getTable' => 'table', 'method' => m::mock(array('getRelated' => m::mock(array('getKeyName' => 'fk'))))));
     $this->config->shouldReceive('getDataModel')->once()->andReturn($model);
     $this->column->shouldReceive('getOption')->once()->andReturn('method');
     $this->assertEquals($this->column->getIncludedColumn(), array('fk' => 'table.fk'));
 }
コード例 #2
0
 public function testGetIncludedColumn()
 {
     $this->config->shouldReceive('getDataModel')->once()->andReturn(m::mock(array('getTable' => 'table')));
     $nested = array('pieces' => array('foo'), 'models' => array(m::mock(array('foo' => m::mock(array('getForeignKey' => 'fk'))))));
     $this->column->shouldReceive('getOption')->once()->andReturn($nested);
     $this->assertEquals($this->column->getIncludedColumn(), array('fk' => 'table.fk'));
 }
コード例 #3
0
 public function testGetIncludedColumnReturnsEmptyArray()
 {
     $this->assertEquals($this->column->getIncludedColumn(), array());
 }