php cs fixer
This commit is contained in:
parent
26abaeb739
commit
189493b045
17 changed files with 44 additions and 43 deletions
|
|
@ -21,10 +21,10 @@ class NodeControllerTest extends TestCase
|
|||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->textRepo = new FakeTextRepository;
|
||||
$this->textRepo = new FakeTextRepository();
|
||||
$this->textRepo->create(new CreateTextDto(name: 'test text'));
|
||||
|
||||
$this->nodeRepo = new FakeNodeRepository;
|
||||
$this->nodeRepo = new FakeNodeRepository();
|
||||
|
||||
$this->controller = new NodeController($this->nodeRepo, $this->textRepo);
|
||||
}
|
||||
|
|
@ -93,12 +93,12 @@ class NodeControllerTest extends TestCase
|
|||
parentNode: null,
|
||||
));
|
||||
|
||||
$body = (new StreamFactory())->createStream(json_encode([
|
||||
$body = new StreamFactory()->createStream(json_encode([
|
||||
'textId' => 0,
|
||||
'title' => 'Child Node',
|
||||
'parentNodeId' => $rootNode->getId(),
|
||||
]));
|
||||
$request = (new ServerRequestFactory())
|
||||
$request = new ServerRequestFactory()
|
||||
->createServerRequest('POST', 'http://localhost/api/nodes')
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withBody($body);
|
||||
|
|
@ -118,11 +118,11 @@ class NodeControllerTest extends TestCase
|
|||
|
||||
public function test_create_node_returns_400_when_title_missing(): void
|
||||
{
|
||||
$body = (new StreamFactory())->createStream(json_encode([
|
||||
$body = new StreamFactory()->createStream(json_encode([
|
||||
'textId' => 0,
|
||||
'parentNodeId' => null,
|
||||
]));
|
||||
$request = (new ServerRequestFactory())
|
||||
$request = new ServerRequestFactory()
|
||||
->createServerRequest('POST', 'http://localhost/api/nodes')
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withBody($body);
|
||||
|
|
@ -138,12 +138,12 @@ class NodeControllerTest extends TestCase
|
|||
|
||||
public function test_create_node_returns_404_when_text_not_found(): void
|
||||
{
|
||||
$body = (new StreamFactory())->createStream(json_encode([
|
||||
$body = new StreamFactory()->createStream(json_encode([
|
||||
'textId' => 99,
|
||||
'title' => 'Some Node',
|
||||
'parentNodeId' => null,
|
||||
]));
|
||||
$request = (new ServerRequestFactory())
|
||||
$request = new ServerRequestFactory()
|
||||
->createServerRequest('POST', 'http://localhost/api/nodes')
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withBody($body);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue