mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-03 17:55:03 +02:00
Applied code style to tests/
This commit is contained in:
parent
f861de791f
commit
fe0f69f762
44 changed files with 427 additions and 306 deletions
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -28,7 +31,7 @@ class BBCodeToMarkdownConverterTest extends TestCase
|
|||
{
|
||||
protected $converter;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->converter = new BBCodeToMarkdownConverter();
|
||||
}
|
||||
|
@ -52,8 +55,8 @@ class BBCodeToMarkdownConverterTest extends TestCase
|
|||
* @param $bbcode
|
||||
* @param $expected
|
||||
*/
|
||||
public function testConvert($bbcode, $expected)
|
||||
public function testConvert($bbcode, $expected): void
|
||||
{
|
||||
$this->assertEquals($expected, $this->converter->convert($bbcode));
|
||||
$this->assertSame($expected, $this->converter->convert($bbcode));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -35,7 +38,7 @@ class TreeViewNodeTest extends TestCase
|
|||
*/
|
||||
protected $node2;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$sub_nodes = [];
|
||||
$sub_nodes[] = new TreeViewNode('Subnode 1');
|
||||
|
@ -50,16 +53,16 @@ class TreeViewNodeTest extends TestCase
|
|||
$this->node2 = new TreeViewNode('Name', 'www.foo.bar', $sub_nodes);
|
||||
}
|
||||
|
||||
public function testConstructor()
|
||||
public function testConstructor(): void
|
||||
{
|
||||
//A node without things should have null values on its properties:
|
||||
$this->assertNull($this->node1->getHref());
|
||||
$this->assertNull($this->node1->getNodes());
|
||||
$this->assertEquals('Name', $this->node1->getText());
|
||||
$this->assertSame('Name', $this->node1->getText());
|
||||
|
||||
//The second node must have the given things as properties.
|
||||
$this->assertEquals('Name', $this->node2->getText());
|
||||
$this->assertEquals('www.foo.bar', $this->node2->getHref());
|
||||
$this->assertSame('Name', $this->node2->getText());
|
||||
$this->assertSame('www.foo.bar', $this->node2->getHref());
|
||||
$this->assertNotEmpty($this->node2->getNodes());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue