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

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