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')); }
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')); }
public function testGetIncludedColumnReturnsEmptyArray() { $this->assertEquals($this->column->getIncludedColumn(), array()); }