5 require_once(
"libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
17 return new \ILIAS\UI\Implementation\Component\Counter\Factory();
24 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Factory", $f);
26 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Counter", $f->status(0));
27 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Counter", $f->novelty(0));
37 $c = $f->status($number);
39 $this->assertNotNull($c);
40 $this->assertEquals(
C\Counter\Counter::STATUS, $c->getType());
41 $this->assertEquals($number, $c->getNumber());
51 $c = $f->novelty($number);
53 $this->assertNotNull($c);
54 $this->assertEquals(
C\Counter\Counter::NOVELTY, $c->getType());
55 $this->assertEquals($number, $c->getNumber());
61 new \ILIAS\UI\Implementation\Component\Counter\Counter(
"FOO", 1);
62 $this->assertFalse(
"We should not get here");
75 $f->status($no_number);
76 $this->assertFalse(
"This should not happen");
95 ,
array(
new stdClass())
100 ,
"novelty" =>
"badge badge-notify il-counter-novelty" 110 $c = $f->$type($number);
114 $css_classes = self::$canonical_css_classes[
$type];
115 $expected =
"<span class=\"$css_classes\">$number</span>";
116 $this->assertEquals($expected,
$html);
122 ,
array(
"novelty", 13)
124 ,
array(
"novelty", 23)
test_render_status($type, $number)
counter_type_and_number_provider
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Provides common functionality for UI tests.
test_known_counters_only()
counter_type_and_number_provider()
test_int_numbers_only($no_number)
no_number_provider
test_implements_factory_interface()
Create styles array
The data for the language used.
static $canonical_css_classes
Defines tests that a counter implementation should pass.
test_status_counter($number)
number_provider
test_novelty_counter($number)
number_provider