Ejemplo n.º 1
0
 public function testMorphOneWhereClausesCanBeRemoved()
 {
     $builder = new EloquentMorphResetBuilderStub();
     $parent = m::mock('Illuminate\\Database\\Eloquent\\Model');
     $parent->shouldReceive('getKey')->andReturn(1);
     $relation = new MorphOne($builder, $parent, 'morph');
     $relation->where('foo', '=', 'bar');
     list($wheres, $bindings) = $relation->getAndResetWheres();
     $this->assertEquals('bar', $bindings[0]);
     $this->assertEquals('Basic', $wheres[0]['type']);
     $this->assertEquals('foo', $wheres[0]['column']);
     $this->assertEquals('bar', $wheres[0]['value']);
 }