19declare(strict_types=1);
22use PHPUnit\Framework\TestCase;
32 $order =
$f->order(
'subject', Order::ASC);
33 $this->assertInstanceOf(Order::class, $order);
37 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
41 [
'subject' => Order::ASC],
46 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
49 $order = $order->
append(
'sub2', Order::DESC);
52 'subject' => Order::ASC,
60 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
64 'SORT BY subject ASC',
67 function ($pre, $k, $v) {
74 #[\PHPUnit\Framework\Attributes\Depends('testAppend')]
78 'Sorting subject ASC, sub2 DESC,',
81 function ($pre, $k, $v) {
88 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
91 $this->expectException(TypeError::class);
92 $order = $order->
append(
'sub3', -1);
95 #[\PHPUnit\Framework\Attributes\Depends('testFactory')]
98 $this->expectException(InvalidArgumentException::class);
99 $order = $order->
append(
'subject', Order::ASC);
Both the subject and the direction need to be specified when expressing an order.
append(string $subject, string $direction)
join($init, callable $fn)
testJoinOne(Order $order)
testInvalidSubject(Order $order)
testJoinMore(Order $order)
testInvalidDirection(Order $order)