ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
orderTest Class Reference
+ Inheritance diagram for orderTest:
+ Collaboration diagram for orderTest:

Public Member Functions

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

Detailed Description

Member Function Documentation

◆ testAppend()

orderTest::testAppend ( Order  $order)

testFactory

Definition at line 33 of file OrderTest.php.

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

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

◆ testFactory()

orderTest::testFactory ( )

Definition at line 11 of file OrderTest.php.

References Vendor\Package\$f.

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

◆ testInvalidDirection()

orderTest::testInvalidDirection ( Order  $order)

testFactory

Definition at line 81 of file OrderTest.php.

References ILIAS\Data\Order\append().

82  {
83  $this->expectException(InvalidArgumentException::class);
84  $order = $order->append('sub3', -1);
85  }
append(string $subject, $direction)
Definition: Order.php:40
+ Here is the call graph for this function:

◆ testInvalidSubject()

orderTest::testInvalidSubject ( Order  $order)

testFactory

Definition at line 90 of file OrderTest.php.

References ILIAS\Data\Order\append().

91  {
92  $this->expectException(InvalidArgumentException::class);
93  $order = $order->append('subject', Order::ASC);
94  }
append(string $subject, $direction)
Definition: Order.php:40
+ Here is the call graph for this function:

◆ testJoinMore()

orderTest::testJoinMore ( Order  $order)

testAppend

Definition at line 65 of file OrderTest.php.

References ILIAS\Data\Order\join().

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

◆ testJoinOne()

orderTest::testJoinOne ( Order  $order)

testFactory

Definition at line 49 of file OrderTest.php.

References ILIAS\Data\Order\join().

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

◆ testValues()

orderTest::testValues ( Order  $order)

testFactory

Definition at line 22 of file OrderTest.php.

References ILIAS\Data\Order\get().

23  {
24  $this->assertEquals(
25  ['subject' => Order::ASC],
26  $order->get()
27  );
28  }
+ Here is the call graph for this function:

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