Craft\ImportServiceTest::testGetCustomOptionShouldReturnOptionWhenFound PHP Method

testGetCustomOptionShouldReturnOptionWhenFound() public method

    public function testGetCustomOptionShouldReturnOptionWhenFound()
    {
        $fieldHandle = 'handle';
        $option = array('optionkey' => 'optionvalue');
        $mockPluginsService = $this->getMock('Craft\\PluginsService');
        $mockPluginsService->expects($this->any())->method('call')->with('registerImportOptionPaths')->willReturn(array(array($fieldHandle => $option)));
        $this->setComponent(craft(), 'plugins', $mockPluginsService);
        $service = new ImportService();
        $result = $service->getCustomOption($fieldHandle);
        $this->assertSame($option, $result);
    }