-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OXDEV-8728 Implemented ResultFileInterface
- Loading branch information
1 parent
0451423
commit 9bc8ebd
Showing
3 changed files
with
57 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\GdprOptinModule\UserData\DataType; | ||
|
||
class ResultFile implements ResultFileInterface | ||
{ | ||
public function __construct( | ||
private readonly string $fileName, | ||
private readonly string $content | ||
) { | ||
} | ||
|
||
public function getFileName(): string | ||
{ | ||
return $this->fileName; | ||
} | ||
|
||
public function getContent(): string | ||
{ | ||
return $this->content; | ||
} | ||
} |
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
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 | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\GdprOptinModule\Tests\Unit\UserData\DataType; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use OxidEsales\GdprOptinModule\UserData\DataType\ResultFile; | ||
|
||
final class ResultFileTest extends TestCase | ||
{ | ||
public function testResultFileDataType(): void | ||
{ | ||
$expectedFileName = uniqid(); | ||
$expectedFileContent = uniqid(); | ||
|
||
$sut = new ResultFile(fileName: $expectedFileName, content: $expectedFileContent); | ||
|
||
$this->assertSame($expectedFileName, $sut->getFilename()); | ||
$this->assertSame($expectedFileContent, $sut->getContent()); | ||
} | ||
} |