ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
orderTest Class Reference
+ Inheritance diagram for orderTest:
+ Collaboration diagram for orderTest:

Public Member Functions

 testFactory ()
 
 testValues (Order $order)
 
 testAppend (Order $order)
 
 testJoinOne (Order $order)
 
 testJoinMore (Order $order)
 
 testInvalidDirection (Order $order)
 
 testInvalidSubject (Order $order)
 

Detailed Description

Member Function Documentation

◆ testAppend()

orderTest::testAppend ( Order  $order)

Definition at line 47 of file OrderTest.php.

47 : Order
48 {
49 $order = $order->append('sub2', Order::DESC);
50 $this->assertEquals(
51 [
52 'subject' => Order::ASC,
53 'sub2' => Order::DESC
54 ],
55 $order->get()
56 );
57 return $order;
58 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
append(string $subject, string $direction)
Definition: Order.php:58

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

+ Here is the call graph for this function:

◆ testFactory()

orderTest::testFactory ( )

Definition at line 29 of file OrderTest.php.

29 : Order
30 {
31 $f = new ILIAS\Data\Factory();
32 $order = $f->order('subject', Order::ASC);
33 $this->assertInstanceOf(Order::class, $order);
34 return $order;
35 }
Builds data types.
Definition: Factory.php:36

References Vendor\Package\$f.

◆ testInvalidDirection()

orderTest::testInvalidDirection ( Order  $order)

Definition at line 89 of file OrderTest.php.

89 : void
90 {
91 $this->expectException(TypeError::class);
92 $order = $order->append('sub3', -1);
93 }

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testInvalidSubject()

orderTest::testInvalidSubject ( Order  $order)

Definition at line 96 of file OrderTest.php.

96 : void
97 {
98 $this->expectException(InvalidArgumentException::class);
99 $order = $order->append('subject', Order::ASC);
100 }

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testJoinMore()

orderTest::testJoinMore ( Order  $order)

Definition at line 75 of file OrderTest.php.

75 : void
76 {
77 $this->assertEquals(
78 'Sorting subject ASC, sub2 DESC,',
79 $order->join(
80 'Sorting',
81 function ($pre, $k, $v) {
82 return "$pre $k $v,";
83 }
84 )
85 );
86 }
join($init, callable $fn)
Definition: Order.php:75

References ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testJoinOne()

orderTest::testJoinOne ( Order  $order)

Definition at line 61 of file OrderTest.php.

61 : void
62 {
63 $this->assertEquals(
64 'SORT BY subject ASC',
65 $order->join(
66 'SORT BY',
67 function ($pre, $k, $v) {
68 return "$pre $k $v";
69 }
70 )
71 );
72 }

References ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testValues()

orderTest::testValues ( Order  $order)

Definition at line 38 of file OrderTest.php.

38 : void
39 {
40 $this->assertEquals(
41 ['subject' => Order::ASC],
42 $order->get()
43 );
44 }

References ILIAS\Data\Order\get().

+ Here is the call graph for this function:

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