ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
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.

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

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:28
append(string $subject, string $direction)
Definition: Order.php:58
+ Here is the call graph for this function:

◆ testFactory()

orderTest::testFactory ( )

Definition at line 29 of file OrderTest.php.

References Vendor\Package\$f.

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  }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ testInvalidDirection()

orderTest::testInvalidDirection ( Order  $order)

Definition at line 89 of file OrderTest.php.

References ILIAS\Data\Order\append().

89  : void
90  {
91  $this->expectException(TypeError::class);
92  $order = $order->append('sub3', -1);
93  }
append(string $subject, string $direction)
Definition: Order.php:58
+ Here is the call graph for this function:

◆ testInvalidSubject()

orderTest::testInvalidSubject ( Order  $order)

Definition at line 96 of file OrderTest.php.

References ILIAS\Data\Order\append().

96  : void
97  {
98  $this->expectException(InvalidArgumentException::class);
99  $order = $order->append('subject', Order::ASC);
100  }
append(string $subject, string $direction)
Definition: Order.php:58
+ Here is the call graph for this function:

◆ testJoinMore()

orderTest::testJoinMore ( Order  $order)

Definition at line 75 of file OrderTest.php.

References ILIAS\Data\Order\join().

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
+ Here is the call graph for this function:

◆ testJoinOne()

orderTest::testJoinOne ( Order  $order)

Definition at line 61 of file OrderTest.php.

References ILIAS\Data\Order\join().

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  }
join($init, callable $fn)
Definition: Order.php:75
+ Here is the call graph for this function:

◆ testValues()

orderTest::testValues ( Order  $order)

Definition at line 38 of file OrderTest.php.

References ILIAS\Data\Order\get().

38  : void
39  {
40  $this->assertEquals(
41  ['subject' => Order::ASC],
42  $order->get()
43  );
44  }
+ Here is the call graph for this function:

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