File tree Expand file tree Collapse file tree 5 files changed +19
-6
lines changed
Controller/Adminhtml/Page
Test/Unit/Controller/Adminhtml/Page
CmsUrlRewrite/Test/Unit/Model
dev/tests/functional/tests/app/Magento/Cms/Test/Constraint Expand file tree Collapse file tree 5 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ class Save extends \Magento\Backend\App\Action
46
46
* @param DataPersistorInterface $dataPersistor
47
47
* @param \Magento\Cms\Model\PageFactory $pageFactory
48
48
* @param \Magento\Cms\Api\PageRepositoryInterface $pageRepository
49
- *
50
49
*/
51
50
public function __construct (
52
51
Action \Context $ context ,
@@ -62,6 +61,7 @@ public function __construct(
62
61
$ this ->pageRepository = $ pageRepository
63
62
?: \Magento \Framework \App \ObjectManager::getInstance ()
64
63
->get (\Magento \Cms \Api \PageRepositoryInterface::class);
64
+
65
65
parent ::__construct ($ context );
66
66
}
67
67
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ protected function setUp()
109
109
'dataProcessor ' => $ this ->dataProcessorMock ,
110
110
'dataPersistor ' => $ this ->dataPersistorMock ,
111
111
'pageFactory ' => $ this ->pageFactory ,
112
- 'pageRepository ' => $ this ->pageRepository
112
+ 'pageRepository ' => $ this ->pageRepository ,
113
113
]
114
114
);
115
115
}
@@ -258,7 +258,9 @@ public function testSaveActionThrowsException()
258
258
->method ('getId ' )
259
259
->willReturn (true );
260
260
$ page ->expects ($ this ->once ())->method ('setData ' );
261
- $ this ->pageRepository ->expects ($ this ->once ())->method ('save ' )->with ($ page )
261
+ $ this ->pageRepository ->expects ($ this ->once ())
262
+ ->method ('save ' )
263
+ ->with ($ page )
262
264
->willThrowException (new \Exception ('Error message. ' ));
263
265
264
266
$ this ->messageManagerMock ->expects ($ this ->never ())
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \CmsUrlRewrite \Test \Unit \Model ;
7
7
8
-
9
8
/**
10
9
* Test for \Magento\CmsUrlRewrite\Model\CmsPageUrlPathGenerator class.
11
10
*/
@@ -56,7 +55,7 @@ protected function setUp()
56
55
[
57
56
'storeManager ' => $ this ->storeManager ,
58
57
'urlRewriteFactory ' => $ this ->urlRewriteFactory ,
59
- 'cmsPageUrlPathGenerator ' => $ this ->urlPathGenerator
58
+ 'cmsPageUrlPathGenerator ' => $ this ->urlPathGenerator ,
60
59
]
61
60
);
62
61
}
@@ -69,6 +68,7 @@ public function testGenerateForAllStores()
69
68
$ cmsPage = $ this ->getMockBuilder (\Magento \Cms \Model \Page::class)
70
69
->disableOriginalConstructor ()
71
70
->getMock ();
71
+
72
72
$ cmsPage ->expects ($ this ->any ())->method ('getStores ' )->willReturn ($ initializesStores );
73
73
$ store = $ this ->getMockBuilder (\Magento \Store \Api \Data \StoreInterface::class)
74
74
->setMethods (['getStoreId ' ])
@@ -96,6 +96,7 @@ public function testGenerateForSpecificStores()
96
96
$ cmsPage = $ this ->getMockBuilder (\Magento \Cms \Model \Page::class)
97
97
->disableOriginalConstructor ()
98
98
->getMock ();
99
+
99
100
$ cmsPage ->expects ($ this ->any ())->method ('getStores ' )->willReturn ($ initializesStores );
100
101
$ firstStore = $ this ->getMockBuilder (\Magento \Store \Api \Data \StoreInterface::class)
101
102
->setMethods (['getStoreId ' ])
Original file line number Diff line number Diff line change @@ -37,4 +37,14 @@ public function processAssert(
37
37
$ errors = $ this ->verifyData ($ cmsFixtureData , $ cmsFormData );
38
38
\PHPUnit_Framework_Assert::assertEmpty ($ errors , $ errors );
39
39
}
40
+
41
+ /**
42
+ * CMS Page content equals to data from fixture.
43
+ *
44
+ * @return string
45
+ */
46
+ public function toString ()
47
+ {
48
+ return 'CMS Page content equals to data from fixture. ' ;
49
+ }
40
50
}
Original file line number Diff line number Diff line change @@ -47,6 +47,6 @@ public function processAssert(
47
47
*/
48
48
public function toString ()
49
49
{
50
- return ' CMS Page content equals to data from fixture. ' ;
50
+ return " CMS Page content isn't displayed on frontend. " ;
51
51
}
52
52
}
You can’t perform that action at this time.
0 commit comments