Skip to content

Commit a1bd1ab

Browse files
author
Bernhard Schmitt
committed
FEATURE: Add unit testing helper dummies for Node, Context and ContentElementEditableService
1 parent d3f1f08 commit a1bd1ab

3 files changed

Lines changed: 896 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace PackageFactory\AtomicFusion\PresentationObjects\Tests\Unit\Helper;
3+
4+
use Neos\ContentRepository\Domain\Model\NodeInterface;
5+
use Neos\Neos\Service\ContentElementEditableService;
6+
7+
/**
8+
* The easily accessible dummy content element editable service for usage in unit tests, e.g. for presentation object factories
9+
*/
10+
class DummyContentElementEditableService extends ContentElementEditableService
11+
{
12+
public function wrapContentProperty(NodeInterface $node, $property, $content)
13+
{
14+
return $content;
15+
}
16+
}

Tests/Unit/Helper/DummyContext.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
namespace PackageFactory\AtomicFusion\PresentationObjects\Tests\Unit\Helper;
3+
4+
use Neos\Neos\Domain\Service\ContentContext;
5+
6+
/**
7+
* The easily accessible dummy node for usage in unit tests, e.g. for presentation object factories
8+
*/
9+
class DummyContext extends ContentContext
10+
{
11+
public $isInBackend = false;
12+
13+
public function isInBackend(): bool
14+
{
15+
return $this->isInBackend;
16+
}
17+
}

0 commit comments

Comments
 (0)