ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ActionTest Class Reference

Basic Tests for Table-Actions. More...

+ Inheritance diagram for ActionTest:
+ Collaboration diagram for ActionTest:

Public Member Functions

 setUp ()
 
 testDataTableActionAttributes ()
 
 testDataTableActionSignalTarget ()
 
 testDataTableActionStringTarget ()
 
 testDataTableActionRowIdOnURI ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Member Functions

 buildFactories ()
 
- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Protected Attributes

Implementation Standard $link_action
 
Data URI $link_target
 
Implementation Standard $signal_action
 
Signal $signal_target
 

Detailed Description

Basic Tests for Table-Actions.

Definition at line 33 of file ActionTest.php.

Member Function Documentation

◆ buildFactories()

ActionTest::buildFactories ( )
protected

Definition at line 40 of file ActionTest.php.

Referenced by setUp(), and testDataTableActionStringTarget().

41  {
42  return [
44  new Data\Factory()
45  ];
46  }
+ Here is the caller graph for this function:

◆ setUp()

ActionTest::setUp ( )

Definition at line 48 of file ActionTest.php.

References Vendor\Package\$f, $token, and buildFactories().

48  : void
49  {
50  list($f, $df) = $this->buildFactories();
51  $target = $df->uri('http://wwww.ilias.de?ref_id=1');
52 
53  $url_builder = new URLBuilder($target);
54  list($builder, $token) = array_values(
55  $url_builder->acquireParameter(['namespace'], 'rowids')
56  );
57 
58  $label = 'label';
59  $this->link_target = $target;
60  $this->link_action = $f->standard($label, $builder, $token);
61  $this->signal_target = new Signal('sig_id');
62  $this->signal_action = $this->link_action->withAsync(true);
63  }
$token
Definition: xapitoken.php:70
buildFactories()
Definition: ActionTest.php:40
URLBuilder.
Definition: URLBuilder.php:39
+ Here is the call graph for this function:

◆ testDataTableActionAttributes()

ActionTest::testDataTableActionAttributes ( )

Definition at line 65 of file ActionTest.php.

References $link_action.

65  : void
66  {
67  $act = $this->link_action;
68  $this->assertEquals('label', $act->getLabel());
69  $this->assertEquals($this->link_target . "&namespace_rowids=", $act->getTarget());
70  $this->assertFalse($this->link_action->isAsync());
71  $this->assertTrue($this->signal_action->isAsync());
72  $this->assertIsString($this->signal_action->getURLBuilderJS());
73  $this->assertIsString($this->signal_action->getURLBuilderTokensJS());
74  }
Implementation Standard $link_action
Definition: ActionTest.php:35

◆ testDataTableActionRowIdOnURI()

ActionTest::testDataTableActionRowIdOnURI ( )

Definition at line 89 of file ActionTest.php.

89  : void
90  {
91  $act = $this->link_action->withRowId('test-id');
92  $this->assertEquals(
93  'ref_id=1&namespace_rowids[]=test-id',
94  urldecode($act->getTarget()->getQuery())
95  );
96  }

◆ testDataTableActionSignalTarget()

ActionTest::testDataTableActionSignalTarget ( )

Definition at line 76 of file ActionTest.php.

76  : void
77  {
78  $act = $this->signal_action->withSignalTarget($this->signal_target);
79  $this->assertEquals($this->signal_target, $act->getTarget());
80  }

◆ testDataTableActionStringTarget()

ActionTest::testDataTableActionStringTarget ( )

Definition at line 82 of file ActionTest.php.

References Vendor\Package\$f, and buildFactories().

82  : void
83  {
84  $this->expectException(\TypeError::class);
85  list($f, $df) = $this->buildFactories();
86  $act = $f->standard('', '', '');
87  }
buildFactories()
Definition: ActionTest.php:40
+ Here is the call graph for this function:

Field Documentation

◆ $link_action

Implementation Standard ActionTest::$link_action
protected

Definition at line 35 of file ActionTest.php.

Referenced by testDataTableActionAttributes().

◆ $link_target

Data URI ActionTest::$link_target
protected

Definition at line 36 of file ActionTest.php.

◆ $signal_action

Implementation Standard ActionTest::$signal_action
protected

Definition at line 37 of file ActionTest.php.

◆ $signal_target

Signal ActionTest::$signal_target
protected

Definition at line 38 of file ActionTest.php.


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