Definition at line 11 of file DesignTest.php.
◆ loadChangeTimezoneDataProvider()
loadChangeTimezoneDataProvider |
( |
| ) |
|
Depending on the current UTC time, either UTC-12:00, or UTC+12:00 timezone points to the different date. If UTC time is between 00:00 and 12:00, UTC+12:00 points to the same day, and UTC-12:00 to the previous day. If UTC time is between 12:00 and 24:00, UTC-12:00 points to the same day, and UTC+12:00 to the next day. Testing the design change with both UTC-12:00 and UTC+12:00 store timezones guarantees that the proper design change is chosen for the timezone with the date different from the UTC.
Definition at line 211 of file DesignTest.php.
221 'default store - UTC+12:00' => [
'default',
'Etc/GMT-12',
'+12 hours'],
222 'default store - UTC-12:00' => [
'default',
'Etc/GMT+12',
'-12 hours'],
223 'admin store - UTC+12:00' => [
'admin',
'Etc/GMT-12',
'+12 hours'],
224 'admin store - UTC-12:00' => [
'admin',
'Etc/GMT+12',
'-12 hours']
◆ setUp()
◆ testChangeDesign()
@magentoDataFixture Magento/Theme/_files/design_change.php
- Returns
- void @covers \Magento\Theme\Model\Design::changeDesign @covers \Magento\Theme\Model\Design::__construct @covers \Magento\Theme\Model\Design::_construct
Definition at line 34 of file DesignTest.php.
37 ->setAreaCode(
'frontend');
39 \
Magento\Framework\View\DesignInterface::class
42 \
Magento\Store\Model\StoreManagerInterface::class
43 )->getDefaultStoreView()->getId();
46 \
Magento\Theme\Model\Design::class
48 $designChange->loadChange(
$storeId)->changeDesign($design);
49 $this->assertEquals(
'Magento/luma', $design->getDesignTheme()->getThemePath());
static getObjectManager()
◆ testCollection()
- Todo:
- fix and add addStoreFilter method
Definition at line 93 of file DesignTest.php.
95 $collection = $this->_model->getCollection()->joinStore()->addDateFilter();
◆ testCRUD()
Definition at line 52 of file DesignTest.php.
54 $this->_model->setData(
57 'design' =>
'Magento/blank',
58 'date_from' => date(
'Y-m-d', strtotime(
'-1 day')),
59 'date_to' => date(
'Y-m-d', strtotime(
'+1 day')),
62 $this->_model->save();
63 $this->assertNotEmpty($this->_model->getId());
67 \
Magento\Theme\Model\Design::class
70 $this->assertEquals($this->_model->getId(),
$model->getId());
76 $this->fail(
'A validation failure is expected.');
77 }
catch (\
Magento\Framework\Exception\LocalizedException $e) {
80 $this->_model->delete();
81 }
catch (\Exception $e) {
82 $this->_model->delete();
87 \
Magento\Theme\Model\Design::class
90 $this->assertEmpty(
$model->getId());
static getObjectManager()
◆ testLoadChange()
Definition at line 25 of file DesignTest.php.
27 $this->_model->loadChange(1);
28 $this->assertNull($this->_model->getId());
◆ $_model
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Theme/Model/DesignTest.php