AcTasksControllerTest::buildModel PHP Метод

buildModel() защищенный Метод

protected buildModel ( $modelAttributes = null )
    protected function buildModel($modelAttributes = null)
    {
        $modelAttributes = $modelAttributes ?: $this->modelAttributes;
        $mock = $this->mock($this->modelName);
        $model = $this->fillMock($mock, $modelAttributes);
        $mock->shouldReceive('where->firstOrFail')->andReturn($model);
        $mock->shouldReceive('save')->andReturn(true);
        $models = collect();
        $models->push($model);
        $mock->shouldReceive('get')->andReturn($models);
        $mock->shouldReceive('all')->andReturn($models->all());
        return $model;
    }