-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
90 additions
and
9 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
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
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
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,46 @@ | ||
<?php | ||
|
||
/* | ||
* This is part of the webuni/front-matter package. | ||
* | ||
* (c) Martin Hasoň <martin.hason@gmail.com> | ||
* (c) Webuni s.r.o. <info@webuni.cz> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Processor; | ||
|
||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
use Webuni\FrontMatter\Processor\ProcessorDecorator; | ||
use Webuni\FrontMatter\Processor\ProcessorInterface; | ||
|
||
final class ProcessorDecoratorTest extends TestCase | ||
{ | ||
private MockObject $wrapped; | ||
private DummyProcessorDecorator $processor; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->wrapped = $this->createMock(ProcessorInterface::class); | ||
$this->processor = new DummyProcessorDecorator($this->wrapped); | ||
} | ||
|
||
public function testParse(): void | ||
{ | ||
$this->wrapped->expects($this->once())->method('parse')->with('{}'); | ||
$this->processor->parse('{}'); | ||
} | ||
|
||
public function testDump(): void | ||
{ | ||
$this->wrapped->expects($this->once())->method('dump')->with(['foo' => 'bar']); | ||
$this->processor->dump(['foo' => 'bar']); | ||
} | ||
} | ||
|
||
final class DummyProcessorDecorator extends ProcessorDecorator | ||
{ | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
foo: bar | ||
1: number | ||
number: 1234 | ||
pi: 3.14159 | ||
date: 2016-05-27 | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
{% set parameters = {foo: "bar", number: 1234, pi: 3.14159, date: (1464307200|date_modify('0sec')), empty: null, multiline: "Multiple\nLine\nString\n", object: {key: "value", datetime: (1605185652|date_modify('0sec')), values: {0: "one", 1: "two", }, }, } %} | ||
{% set parameters = {foo: "bar", 1: "number", number: 1234, pi: 3.14159, date: (1464307200|date_modify('0sec')), empty: null, multiline: "Multiple\nLine\nString\n", object: {key: "value", datetime: (1605185652|date_modify('0sec')), values: {0: "one", 1: "two", }, }, } %} |