Skip to content

Commit 1a6ee26

Browse files
committed
adding json test
1 parent ff87b60 commit 1a6ee26

4 files changed

Lines changed: 214 additions & 6 deletions

File tree

php-unit/app/Examples/Auth.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
class Auth
66
{
7-
public string $credentials;
8-
97
public static string $login;
10-
11-
public function __construct(public string $email)
8+
9+
public function __construct(public string $email, public string $credentials)
1210
{
1311
$this->email = $email;
1412
}

php-unit/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"php": "^8.0 | ^8.1"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^9.5"
19+
"phpunit/phpunit": "^9.5",
20+
"helmich/phpunit-json-assert": "^3.4"
2021
}
2122
}

php-unit/composer.lock

Lines changed: 194 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php-unit/tests/JsonTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Helmich\JsonAssert\JsonAssertions;
7+
8+
class JsonTest extends TestCase
9+
{
10+
use JsonAssertions;
11+
12+
public function testIfTrue()
13+
{
14+
$this->assertTrue(true);
15+
}
16+
}

0 commit comments

Comments
 (0)