/** @test */ public function it_can_retrieve_the_available_attributes() { $entity = new EntityStub(); $entity->exists = true; $entity->abc = 'foobar'; $entity->getConnection()->getQueryGrammar()->shouldReceive('compileSelect')->once(); $entity->getConnection()->shouldReceive('select')->once(); $entity->getConnection()->getPostProcessor()->shouldReceive('processSelect')->once()->andReturn($builder = m::mock('Illuminate\\Database\\Query\\Builder')); $this->assertInstanceOf('Illuminate\\Support\\Collection', $entity::availableAttributes()); }