File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
app/code/Magento/Theme/Test/Unit/Plugin Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 1212use PHPUnit \Framework \MockObject \MockObject ;
1313use PHPUnit \Framework \TestCase ;
1414
15+ /**
16+ * This Unit Test covers a Plugin (not Collection), overriding the `curPage` (current page)
17+ *
18+ * @see \Magento\Framework\Data\Collection
19+ */
1520class CollectionTest extends TestCase
1621{
17- /** @var MockObject|Collection */
22+ /**
23+ * @var Collection|MockObject
24+ */
1825 private $ dataCollectionMock ;
1926
27+ /**
28+ * @inheritdoc
29+ */
2030 protected function setUp (): void
2131 {
2232 $ this ->dataCollectionMock = $ this ->getMockBuilder (Collection::class)
@@ -25,7 +35,12 @@ protected function setUp(): void
2535 ->getMock ();
2636 }
2737
28- public function testCurrentPageIsNotOverriddenIfFirstPage ()
38+ /**
39+ * Test covers use-case for the first page of results. We don't expect calculation of the last page to be executed.
40+ *
41+ * @return void
42+ */
43+ public function testCurrentPageIsNotOverriddenIfFirstPage (): void
2944 {
3045 // Given
3146 $ currentPagePlugin = new CollectionPlugin ();
@@ -38,7 +53,12 @@ public function testCurrentPageIsNotOverriddenIfFirstPage()
3853 $ currentPagePlugin ->afterGetCurPage ($ this ->dataCollectionMock , 1 );
3954 }
4055
41- public function testCurrentPageIsOverriddenIfNotAFirstPage ()
56+ /**
57+ * Test covers use-case for non-first page of results. We expect calculation of the last page to be executed.
58+ *
59+ * @return void
60+ */
61+ public function testCurrentPageIsOverriddenIfNotAFirstPage (): void
4262 {
4363 // Given
4464 $ currentPagePlugin = new CollectionPlugin ();
You can’t perform that action at this time.
0 commit comments