ILIAS  release_7 Revision v7.30-3-g800a261c036
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 33 of file OrderTest.php.

34 {
35 $order = $order->append('sub2', Order::DESC);
36 $this->assertEquals(
37 [
38 'subject' => Order::ASC,
39 'sub2' => Order::DESC
40 ],
41 $order->get()
42 );
43 return $order;
44 }
append(string $subject, $direction)
Definition: Order.php:40

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

+ Here is the call graph for this function:

◆ testFactory()

orderTest::testFactory ( )

Definition at line 11 of file OrderTest.php.

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

References Vendor\Package\$f.

◆ testInvalidDirection()

orderTest::testInvalidDirection ( Order  $order)

@depends testFactory

Definition at line 81 of file OrderTest.php.

82 {
83 $this->expectException(InvalidArgumentException::class);
84 $order = $order->append('sub3', -1);
85 }

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testInvalidSubject()

orderTest::testInvalidSubject ( Order  $order)

@depends testFactory

Definition at line 90 of file OrderTest.php.

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

References ILIAS\Data\Order\append().

+ Here is the call graph for this function:

◆ testJoinMore()

orderTest::testJoinMore ( Order  $order)

@depends testAppend

Definition at line 65 of file OrderTest.php.

66 {
67 $this->assertEquals(
68 'Sorting subject ASC, sub2 DESC,',
69 $order->join(
70 'Sorting',
71 function ($pre, $k, $v) {
72 return "$pre $k $v,";
73 }
74 )
75 );
76 }
join($init, callable $fn)
Definition: Order.php:54

References ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testJoinOne()

orderTest::testJoinOne ( Order  $order)

@depends testFactory

Definition at line 49 of file OrderTest.php.

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

References ILIAS\Data\Order\join().

+ Here is the call graph for this function:

◆ testValues()

orderTest::testValues ( Order  $order)

@depends testFactory

Definition at line 22 of file OrderTest.php.

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

References ILIAS\Data\Order\get().

+ Here is the call graph for this function:

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