Skip to content

Commit 6555c1a

Browse files
committed
🤣
1 parent 8d75952 commit 6555c1a

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

app/code/Magento/Theme/Test/Unit/Plugin/CollectionTest.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@
1212
use PHPUnit\Framework\MockObject\MockObject;
1313
use 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+
*/
1520
class 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();

0 commit comments

Comments
 (0)