5 require_once(
"libs/composer/vendor/autoload.php");
6 require_once(__DIR__.
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
15 return new \ILIAS\UI\Implementation\Component\Counter\Factory();
21 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Factory", $f);
23 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Counter", $f->status(0));
24 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Counter\\Counter", $f->novelty(0));
33 $c = $f->status($number);
35 $this->assertNotNull($c);
36 $this->assertEquals(
C\Counter\Counter::STATUS, $c->getType());
37 $this->assertEquals($number, $c->getNumber());
46 $c = $f->novelty($number);
48 $this->assertNotNull($c);
49 $this->assertEquals(
C\Counter\Counter::NOVELTY, $c->getType());
50 $this->assertEquals($number, $c->getNumber());
55 new \ILIAS\UI\Implementation\Component\Counter\Counter(
"FOO", 1);
56 $this->assertFalse(
"We should not get here");
68 $f->status($no_number);
69 $this->assertFalse(
"This should not happen");
88 ,
array(
new stdClass())
93 (
"status" =>
"badge badge-notify il-counter-status" 94 ,
"novelty" =>
"badge badge-notify il-counter-novelty" 103 $c = $f->$type($number);
107 $css_classes = self::$canonical_css_classes[$type];
108 $expected =
"<span class=\"$css_classes\">$number</span>";
109 $this->assertEquals($expected,
$html);
114 (
array(
"status", 42)
115 ,
array(
"novelty", 13)
117 ,
array(
"novelty", 23)
test_render_status($type, $number)
counter_type_and_number_provider
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