-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from skuhnow/master
feat: make custom fields protected to allow overrides in custom baske…
- Loading branch information
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/unit/Mathielen/SapOci/Model/OciExtendedBasketItemTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Mathielen\SapOci\Model; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class OciExtendedBasketItemTest extends TestCase | ||
{ | ||
|
||
public function testSetOverriddenCustomField(): void | ||
{ | ||
$sut = new OciExtendedBasketItem(); | ||
$testString21Chars = \str_repeat('x', 21); | ||
$sut->setCustField4($testString21Chars); | ||
$this->assertEquals($testString21Chars, $sut->getCustField4()); | ||
} | ||
} | ||
|
||
class OciExtendedBasketItem extends OciBaseBasketItem | ||
{ | ||
public function setCustField4(?string $custField4 = null): OciBaseBasketItem | ||
{ | ||
$this->custField4 = $custField4; | ||
|
||
return $this; | ||
} | ||
} |