ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * Unit tests for the html_writer class. * * @package core * @category phpunit * @copyright 2010 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir . '/outputcomponents.php'); /** * Unit tests for the html_writer class. * * @copyright 2010 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @covers \html_writer * @coversDefaultClass \html_writer */ class html_writer_test extends basic_testcase { /** * @covers ::start_tag */ public function test_start_tag() { $this->assertSame('
', html_writer::start_tag('div')); } /** * @covers ::start_tag */ public function test_start_tag_with_attr() { $this->assertSame('
', html_writer::start_tag('div', array('class' => 'frog'))); } /** * @covers ::start_tag */ public function test_start_tag_with_attrs() { $this->assertSame('
', html_writer::start_tag('div', array('class' => 'frog', 'id' => 'mydiv'))); } /** * @covers ::end_tag */ public function test_end_tag() { $this->assertSame('
', html_writer::end_tag('div')); } /** * @covers ::empty_Tag */ public function test_empty_tag() { $this->assertSame('
', html_writer::empty_tag('br')); } /** * @covers ::empty_Tag */ public function test_empty_tag_with_attrs() { $this->assertSame('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => 'frog'))); } /** * @covers ::nonempty_tag */ public function test_nonempty_tag_with_content() { $this->assertSame('
Hello world!
', html_writer::nonempty_tag('div', 'Hello world!')); } /** * @covers ::nonempty_tag */ public function test_nonempty_tag_empty() { $this->assertSame('', html_writer::nonempty_tag('div', '')); } /** * @covers ::nonempty_tag */ public function test_nonempty_tag_null() { $this->assertSame('', html_writer::nonempty_tag('div', null)); } /** * @covers ::nonempty_tag */ public function test_nonempty_tag_zero() { $this->assertSame('
0
', html_writer::nonempty_tag('div', 0, array('class' => 'score'))); } /** * @covers ::nonempty_tag */ public function test_nonempty_tag_zero_string() { $this->assertSame('
0
', html_writer::nonempty_tag('div', '0', array('class' => 'score'))); } /** * @covers ::div */ public function test_div() { // All options. $this->assertSame('
ribbit
', html_writer::div('ribbit', 'frog', array('id' => 'kermit'))); // Combine class from attributes and $class. $this->assertSame('
ribbit
', html_writer::div('ribbit', 'frog', array('class' => 'amphibian'))); // Class only. $this->assertSame('
ribbit
', html_writer::div('ribbit', 'frog')); // Attributes only. $this->assertSame('
ribbit
', html_writer::div('ribbit', '', array('id' => 'kermit'))); // No options. $this->assertSame('
ribbit
', html_writer::div('ribbit')); } /** * @covers ::start_div */ public function test_start_div() { // All options. $this->assertSame('
', html_writer::start_div('frog', array('id' => 'kermit'))); // Combine class from attributes and $class. $this->assertSame('
', html_writer::start_div('frog', array('class' => 'amphibian'))); // Class only. $this->assertSame('
', html_writer::start_div('frog')); // Attributes only. $this->assertSame('
', html_writer::start_div('', array('id' => 'kermit'))); // No options. $this->assertSame('
', html_writer::start_div()); } /** * @covers ::end_div */ public function test_end_div() { $this->assertSame('
', html_writer::end_div()); } /** * @covers ::span */ public function test_span() { // All options. $this->assertSame('ribbit', html_writer::span('ribbit', 'frog', array('id' => 'kermit'))); // Combine class from attributes and $class. $this->assertSame('ribbit', html_writer::span('ribbit', 'frog', array('class' => 'amphibian'))); // Class only. $this->assertSame('ribbit', html_writer::span('ribbit', 'frog')); // Attributes only. $this->assertSame('ribbit', html_writer::span('ribbit', '', array('id' => 'kermit'))); // No options. $this->assertSame('ribbit', html_writer::span('ribbit')); } /** * @covers ::start_span */ public function test_start_span() { // All options. $this->assertSame('', html_writer::start_span('frog', array('id' => 'kermit'))); // Combine class from attributes and $class. $this->assertSame('', html_writer::start_span('frog', array('class' => 'amphibian'))); // Class only. $this->assertSame('', html_writer::start_span('frog')); // Attributes only. $this->assertSame('', html_writer::start_span('', array('id' => 'kermit'))); // No options. $this->assertSame('', html_writer::start_span()); } /** * @covers ::end_span */ public function test_end_span() { $this->assertSame('', html_writer::end_span()); } /** * @covers ::table * @covers \html_table_row * @covers \html_table_cell * @covers \html_table */ public function test_table() { $row = new html_table_row(); // The attribute will get overwritten by the ID. $row->id = 'Bob'; $row->attributes['id'] = 'will get overwritten'; // The data-name will be present in the output. $row->attributes['data-name'] = 'Fred'; $cell = new html_table_cell(); // The attribute will get overwritten by the ID. $cell->id = 'Jeremy'; $cell->attributes['id'] = 'will get overwritten'; // The data-name will be present in the output. $cell->attributes['data-name'] = 'John'; $row->cells[] = $cell; $table = new html_table(); $table->responsive = false; // The attribute will get overwritten by the ID. $table->id = 'Jeffrey'; $table->attributes['id'] = 'will get overwritten'; // The data-name will be present in the output. $table->attributes['data-name'] = 'Colin'; // The attribute will get overwritten by the ID above. $table->data[] = $row; // Specify a caption to be output. $table->caption = "A table of meaningless data."; $output = html_writer::table($table); $expected = << A table of meaningless data. EOF; $this->assertSame($expected, $output); } /** * @covers ::table */ public function test_table_hidden_caption() { $table = new html_table(); $table->id = "whodat"; $table->data = array( array('fred', 'MDK'), array('bob', 'Burgers'), array('dave', 'Competitiveness') ); $table->caption = "Who even knows?"; $table->captionhide = true; $table->responsive = false; $output = html_writer::table($table); $expected = << Who even knows? fred MDK bob Burgers dave Competitiveness EOF; $this->assertSame($expected, $output); } }