You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

8 months ago
<?php
use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
8 months ago
use PHPUnit\Framework\TestCase;
7 months ago
final class QueryBuilderPutTest extends TestCase
8 months ago
{
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();
}
}