Browse Source

some tests

dev
Cerys 4 weeks ago
parent
commit
dcfc644e44
  1. 20
      tests/QueryBuilderDirectoryTest.php
  2. 20
      tests/QueryBuilderPermissionsTest.php
  3. 20
      tests/QueryBuilderReferencesTest.php

20
tests/QueryBuilderDirectoryTest.php

@ -0,0 +1,20 @@
<?php
use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
use PHPUnit\Framework\TestCase;
final class QueryBuilderDirectoryTest extends TestCase
{
public function testReferenceQuery()
{
$query = QueryBuilder::Directory()
->RelativePath("{00000000-0000-0000-0000-000000000000}")
->Build();
self::assertEquals(
expected: 'DIRECTORY {00000000-0000-0000-0000-000000000000}',
actual: $query
);
}
}

20
tests/QueryBuilderPermissionsTest.php

@ -0,0 +1,20 @@
<?php
use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
use PHPUnit\Framework\TestCase;
final class QueryBuilderPermissionsTest extends TestCase
{
public function testReferenceQuery()
{
$query = QueryBuilder::Permission()
->On("{00000000-0000-0000-0000-000000000000}")
->Build();
self::assertEquals(
expected: 'PERMISSIONS ON {00000000-0000-0000-0000-000000000000}',
actual: $query
);
}
}

20
tests/QueryBuilderReferencesTest.php

@ -0,0 +1,20 @@
<?php
use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
use PHPUnit\Framework\TestCase;
final class QueryBuilderReferencesTest extends TestCase
{
public function testReferenceQuery()
{
$query = QueryBuilder::References()
->RelativePath("{00000000-0000-0000-0000-000000000000}")
->Build();
self::assertEquals(
expected: 'REFERENCES {00000000-0000-0000-0000-000000000000}',
actual: $query
);
}
}
Loading…
Cancel
Save