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 12
12
use PHPUnit \Framework \MockObject \MockObject ;
13
13
use PHPUnit \Framework \TestCase ;
14
14
15
+ /**
16
+ * This Unit Test covers a Plugin (not Collection), overriding the `curPage` (current page)
17
+ *
18
+ * @see \Magento\Framework\Data\Collection
19
+ */
15
20
class CollectionTest extends TestCase
16
21
{
17
- /** @var MockObject|Collection */
22
+ /**
23
+ * @var Collection|MockObject
24
+ */
18
25
private $ dataCollectionMock ;
19
26
27
+ /**
28
+ * @inheritdoc
29
+ */
20
30
protected function setUp (): void
21
31
{
22
32
$ this ->dataCollectionMock = $ this ->getMockBuilder (Collection::class)
@@ -25,7 +35,12 @@ protected function setUp(): void
25
35
->getMock ();
26
36
}
27
37
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
29
44
{
30
45
// Given
31
46
$ currentPagePlugin = new CollectionPlugin ();
@@ -38,7 +53,12 @@ public function testCurrentPageIsNotOverriddenIfFirstPage()
38
53
$ currentPagePlugin ->afterGetCurPage ($ this ->dataCollectionMock , 1 );
39
54
}
40
55
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
42
62
{
43
63
// Given
44
64
$ currentPagePlugin = new CollectionPlugin ();
You can’t perform that action at this time.
0 commit comments