public function testIsScopeDateInInterval() { $scope = $this->getMock('Magento\\Framework\\App\\ScopeInterface', ['getCode', 'getId']); $this->scopeResolver->expects($this->any())->method('getScope')->will($this->returnValue($scope)); $this->dateTime->expects($this->at(0))->method('isEmptyDate')->will($this->returnValue(false)); $this->dateTime->expects($this->at(1))->method('isEmptyDate')->will($this->returnValue(false)); $this->dateTime->expects($this->at(2))->method('isEmptyDate')->will($this->returnValue(true)); $this->dateTime->expects($this->at(3))->method('isEmptyDate')->will($this->returnValue(true)); $this->assertFalse($this->timezone->isScopeDateInInterval('store')); $this->assertTrue($this->timezone->isScopeDateInInterval('store', null, '10 September 2036')); }
/** * @expectedException \Magento\Framework\Exception\State\InitException */ public function testGetScopeWithInvalidScope() { $scopeMock = new \StdClass(); $this->_storeManagerMock->expects($this->once())->method('getStore')->with(0)->will($this->returnValue($scopeMock)); $this->assertEquals($scopeMock, $this->_model->getScope()); }