php cs fixer

This commit is contained in:
Yisroel Baum 2026-04-19 23:07:48 +03:00
parent 26abaeb739
commit 189493b045
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
17 changed files with 44 additions and 43 deletions

View file

@ -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);