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.
		
		
		
		
		
			
		
			
				
					
					
						
							79 lines
						
					
					
						
							2.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							79 lines
						
					
					
						
							2.5 KiB
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								use Darksparrow\DeegraphInteractions\Exceptions\QueryBuilderConflictingFieldAlreadyExistsException;
							 | 
						|
								use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
							 | 
						|
								use PHPUnit\Framework\TestCase;
							 | 
						|
								
							 | 
						|
								final class QueryBuilderLinkTest extends TestCase
							 | 
						|
								{
							 | 
						|
								    private string $TestUUID = "{00000000-0000-0000-0000-000000000000}";
							 | 
						|
								
							 | 
						|
								    public function test0()
							 | 
						|
								    {
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} TO {$this->TestUUID} AS test",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkToRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								    public function test1()
							 | 
						|
								    {
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} TO {$this->TestUUID} AS test OVERWRITE",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkToRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->overwrite()
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								    public function test2()
							 | 
						|
								    {
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} TO {$this->TestUUID} AS test REPLACE",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkToRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->replace()
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								    public function test3()
							 | 
						|
								    {
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} TO {$this->TestUUID} AS test FORCE",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkToRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->force()
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								    public function test4()
							 | 
						|
								    {
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} OF {$this->TestUUID} AS test",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkOfRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								    public function test5()
							 | 
						|
								    {
							 | 
						|
								        self::expectException(QueryBuilderConflictingFieldAlreadyExistsException::class);
							 | 
						|
								        self::assertEquals(
							 | 
						|
								            expected: "LINK {$this->TestUUID} OF {$this->TestUUID} AS test",
							 | 
						|
								            actual: QueryBuilder::Link()
							 | 
						|
								                ->linkOfRelativePath($this->TestUUID, $this->TestUUID)
							 | 
						|
								                ->as("test")
							 | 
						|
								                ->overwrite()
							 | 
						|
								                ->replace()
							 | 
						|
								                ->force()
							 | 
						|
								                ->build()
							 | 
						|
								        );
							 | 
						|
								    }
							 | 
						|
								}
							 | 
						|
								
							 |