AcControllerResourceTest::testShouldFindRecordThroughHasOneAssociationWithSingletonOptionWithoutIdParam PHP Method

testShouldFindRecordThroughHasOneAssociationWithSingletonOptionWithoutIdParam() public method

Should find record through hasOne association with 'singleton' option without id param
    public function testShouldFindRecordThroughHasOneAssociationWithSingletonOptionWithoutIdParam()
    {
        $this->params = array_merge($this->params, array_merge(['action' => 'show', 'id' => null]));
        $category = $this->mock('Category');
        $this->setProperty($this->controller, 'category', $category);
        $category->shouldReceive('project')->once()->andReturn('some_project');
        $resource = new Efficiently\AuthorityController\ControllerResource($this->controller, ['through' => 'category', 'singleton' => true]);
        $resource->loadResource();
        $this->assertEquals($this->getProperty($this->controller, 'project'), 'some_project');
    }
AcControllerResourceTest