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.

32 lines
1.2 KiB

7 months ago
<?php
use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
7 months ago
use PHPUnit\Framework\TestCase;
6 months ago
final class QueryBuilderPutTest extends TestCase
7 months ago
{
public function testPutURIAtSafeWithValidData()
{
$query = QueryBuilder::Put()
7 months ago
->URI("https://schemas.auxiliumsoftware.co.uk/v1/collection.json")
->At(relativePath: "{970334ed-1f4f-465a-94d7-923a99698786}/todos")
7 months ago
->Safe();
7 months ago
self::assertEquals(
expected: 'PUT URI "https://schemas.auxiliumsoftware.co.uk/v1/collection.json" AT {970334ed-1f4f-465a-94d7-923a99698786}/todos SAFE',
actual: $query->Build()->AsString(),
7 months ago
);
}
public function testPutWithBothThings()
{
$this->expectException(QueryBuilderConflictingFieldAlreadyExistsException::class);
$query = QueryBuilder::Put()
7 months ago
->URI("https://schemas.auxiliumsoftware.co.uk/v1/collection.json")
->At(relativePath: "{970334ed-1f4f-465a-94d7-923a99698786}/todos")
7 months ago
->Into(relativePath: "Relative Path", propertyName: "OwO")
->Safe();
}
}