Cerys Lewis
7 months ago
4 changed files with 1782 additions and 2 deletions
@ -1,3 +1,4 @@ |
|||||
.idea/ |
.idea/ |
||||
composer.phar |
composer.phar |
||||
vendor/ |
vendor/ |
||||
|
*.cache |
||||
|
File diff suppressed because it is too large
@ -0,0 +1,32 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
use Darksparrow\DeegraphPHP\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException; |
||||
|
use Darksparrow\DeegraphPHP\QueryBuilder\QueryBuilder; |
||||
|
use PHPUnit\Framework\TestCase; |
||||
|
|
||||
|
final class QueryBuilderPutTests extends TestCase |
||||
|
{ |
||||
|
public function testPutURIAtSafeWithValidData() |
||||
|
{ |
||||
|
$queryBuilder = new QueryBuilder(); |
||||
|
$query = $queryBuilder->Put() |
||||
|
->URI("https://schemas.auxiliumsoftware.co.uk/v1/collection.json") |
||||
|
->At(node: "970334ed-1f4f-465a-94d7-923a99698786", uwu: "todos") |
||||
|
->Safe(); |
||||
|
self::assertEquals( |
||||
|
expected: 'PUT URI "https://schemas.auxiliumsoftware.co.uk/v1/collection.json" AT {970334ed-1f4f-465a-94d7-923a99698786}/todos SAFE', |
||||
|
actual: $query |
||||
|
); |
||||
|
} |
||||
|
public function testPutWithBothThings() |
||||
|
{ |
||||
|
$this->expectException(QueryBuilderConflictingFieldAlreadyExistsException::class); |
||||
|
$queryBuilder = new QueryBuilder(); |
||||
|
$query = $queryBuilder->Put() |
||||
|
->URI("https://schemas.auxiliumsoftware.co.uk/v1/collection.json") |
||||
|
->At(node: "970334ed-1f4f-465a-94d7-923a99698786", uwu: "todos") |
||||
|
->Into(relativePath: "Relative Path", propertyName: "OwO") |
||||
|
->Safe(); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue