/** * @test * @return void * @covers \Magento\Theme\Model\Layout\Source\Layout::toOptionArray * @covers \Magento\Theme\Model\Layout\Source\Layout::getOptions * @covers \Magento\Theme\Model\Layout\Source\Layout::getDefaultValue * @covers \Magento\Theme\Model\Layout\Source\Layout::__construct */ public function testToOptionArray() { $data = ['code' => 'testCode', 'label' => 'testLabel', 'is_default' => true]; $expectedResult = [['value' => '', 'label' => __('-- Please Select --')], ['value' => 'testCode', 'label' => 'testLabel']]; $this->config->expects($this->once())->method('getPageLayouts')->willReturn([new Object($data)]); $this->assertEquals($expectedResult, $this->_model->toOptionArray(true)); $this->assertEquals('testCode', $this->_model->getDefaultValue()); }