ILIAS  release_8 Revision v8.24
orderTest Class Reference
+ Inheritance diagram for orderTest:
+ Collaboration diagram for orderTest:

Public Member Functions

 testFactory ()
 
 testValues (Order $order)
 @depends testFactory More...
 
 testAppend (Order $order)
 @depends testFactory More...
 
 testJoinOne (Order $order)
 @depends testFactory More...
 
 testJoinMore (Order $order)
 @depends testAppend More...
 
 testInvalidDirection (Order $order)
 @depends testFactory More...
 
 testInvalidSubject (Order $order)
 @depends testFactory More...
 

Detailed Description

Member Function Documentation

◆ testAppend()

orderTest::testAppend ( Order  $order)

@depends testFactory

Definition at line 35 of file OrderTest.php.

35 : Order
36 {
37 $order = $order->append('sub2', Order::DESC);
38 $this->assertEquals(
39 [
40 'subject' => Order::ASC,
41 'sub2' => Order::DESC
42 ],
43 $order->get()
44 );
45 return $order;
46 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:13
append(string $subject, string $direction)
Definition: Order.php:42

References ILIAS\Data\Order\append(), and ILIAS\Data\Order\get().

+ Here is the call graph for this function:

◆ testFactory()

orderTest::testFactory ( )

Definition at line 13 of file OrderTest.php.

13 : Order
14 {
15 $f = new ILIAS\Data\Factory();
16 $order = $f->order('subject', Order::ASC);
17 $this->assertInstanceOf(Order::class, $order);
18 return $order;
19 }
Builds data types.
Definition: Factory.php:21

References Vendor\Package\$f.

◆ testInvalidDirection()

orderTest::testInvalidDirection ( Order  $order)

@depends testFactory

Definition at line 83 of file OrderTest.php.

83 : void
84 {
85 $this->expectException(TypeError::class);
86 $order = $order->append('sub3', -1);
87 }

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testInvalidSubject()

orderTest::testInvalidSubject ( Order  $order)

@depends testFactory

Definition at line 92 of file OrderTest.php.

92 : void
93 {
94 $this->expectException(InvalidArgumentException::class);
95 $order = $order->append('subject', Order::ASC);
96 }

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testJoinMore()

orderTest::testJoinMore ( Order  $order)

@depends testAppend

Definition at line 67 of file OrderTest.php.

67 : void
68 {
69 $this->assertEquals(
70 'Sorting subject ASC, sub2 DESC,',
71 $order->join(
72 'Sorting',
73 function ($pre, $k, $v) {
74 return "$pre $k $v,";
75 }
76 )
77 );
78 }
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9
join($init, callable $fn)
Definition: Order.php:59

References function, and ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testJoinOne()

orderTest::testJoinOne ( Order  $order)

@depends testFactory

Definition at line 51 of file OrderTest.php.

51 : void
52 {
53 $this->assertEquals(
54 'SORT BY subject ASC',
55 $order->join(
56 'SORT BY',
57 function ($pre, $k, $v) {
58 return "$pre $k $v";
59 }
60 )
61 );
62 }

References function, and ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testValues()

orderTest::testValues ( Order  $order)

@depends testFactory

Definition at line 24 of file OrderTest.php.

24 : void
25 {
26 $this->assertEquals(
27 ['subject' => Order::ASC],
28 $order->get()
29 );
30 }

References ILIAS\Data\Order\get().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: