Best Cucumber Common Library code snippet using TableCell
parser_table.test.php
Source:parser_table.test.php
1<?php2require_once 'parser.inc.php';3class TestOfDoku_Parser_Table extends TestOfDoku_Parser {4 function testTable() {5 $this->P->addMode('table',new Doku_Parser_Mode_Table());6 $this->P->parse('7abc8| Row 0 Col 1 | Row 0 Col 2 | Row 0 Col 3 |9| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |10def');11 $calls = array (12 array('document_start',array()),13 array('p_open',array()),14 array('cdata',array("\n\nabc")),15 array('p_close',array()),16 array('table_open',array(3, 2, 6)),17 array('tablerow_open',array()),18 array('tablecell_open',array(1,'left',1)),19 array('cdata',array(' Row 0 Col 1 ')),20 array('tablecell_close',array()),21 array('tablecell_open',array(1,'left',1)),22 array('cdata',array(' Row 0 Col 2 ')),23 array('tablecell_close',array()),24 array('tablecell_open',array(1,'left',1)),25 array('cdata',array(' Row 0 Col 3 ')),26 array('tablecell_close',array()),27 array('tablerow_close',array()),28 array('tablerow_open',array()),29 array('tablecell_open',array(1,'left',1)),30 array('cdata',array(' Row 1 Col 1 ')),31 array('tablecell_close',array()),32 array('tablecell_open',array(1,'left',1)),33 array('cdata',array(' Row 1 Col 2 ')),34 array('tablecell_close',array()),35 array('tablecell_open',array(1,'left',1)),36 array('cdata',array(' Row 1 Col 3 ')),37 array('tablecell_close',array()),38 array('tablerow_close',array()),39 array('table_close',array(121)),40 array('p_open',array()),41 array('cdata',array('def')),42 array('p_close',array()),43 array('document_end',array()),44 );45 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));46 }47 function testTableWinEOL() {48 $this->P->addMode('table',new Doku_Parser_Mode_Table());49 $this->P->parse("\r\nabc\r\n| Row 0 Col 1 | Row 0 Col 2 | Row 0 Col 3 |\r\n| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |\r\ndef");50 $calls = array (51 array('document_start',array()),52 array('p_open',array()),53 array('cdata',array("\n\nabc")),54 array('p_close',array()),55 array('table_open',array(3, 2, 6)),56 array('tablerow_open',array()),57 array('tablecell_open',array(1,'left',1)),58 array('cdata',array(' Row 0 Col 1 ')),59 array('tablecell_close',array()),60 array('tablecell_open',array(1,'left',1)),61 array('cdata',array(' Row 0 Col 2 ')),62 array('tablecell_close',array()),63 array('tablecell_open',array(1,'left',1)),64 array('cdata',array(' Row 0 Col 3 ')),65 array('tablecell_close',array()),66 array('tablerow_close',array()),67 array('tablerow_open',array()),68 array('tablecell_open',array(1,'left',1)),69 array('cdata',array(' Row 1 Col 1 ')),70 array('tablecell_close',array()),71 array('tablecell_open',array(1,'left',1)),72 array('cdata',array(' Row 1 Col 2 ')),73 array('tablecell_close',array()),74 array('tablecell_open',array(1,'left',1)),75 array('cdata',array(' Row 1 Col 3 ')),76 array('tablecell_close',array()),77 array('tablerow_close',array()),78 array('table_close',array(121)),79 array('p_open',array()),80 array('cdata',array('def')),81 array('p_close',array()),82 array('document_end',array()),83 );84 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));85 }86 function testEmptyTable() {87 $this->P->addMode('table',new Doku_Parser_Mode_Table());88 $this->P->parse('89abc90|91def');92 $calls = array (93 array('document_start',array()),94 array('p_open',array()),95 array('cdata',array("\n\nabc")),96 array('p_close',array()),97 array('table_open',array(0, 1, 6)),98 array('tablerow_open',array()),99 array('tablerow_close',array()),100 array('table_close',array(7)),101 array('p_open',array()),102 array('cdata',array('def')),103 array('p_close',array()),104 array('document_end',array()),105 );106 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));107 }108 function testTableHeaders() {109 $this->P->addMode('table',new Doku_Parser_Mode_Table());110 $this->P->parse('111abc112^ X | Y ^ Z |113def');114 $calls = array (115 array('document_start',array()),116 array('p_open',array()),117 array('cdata',array("\n\nabc")),118 array('p_close',array()),119 array('table_open',array(3, 1, 6)),120 array('tablerow_open',array()),121 array('tableheader_open',array(1,NULL,1)),122 array('cdata',array(' X ')),123 array('tableheader_close',array()),124 array('tablecell_open',array(1,NULL,1)),125 array('cdata',array(' Y ')),126 array('tablecell_close',array()),127 array('tableheader_open',array(1,NULL,1)),128 array('cdata',array(' Z ')),129 array('tableheader_close',array()),130 array('tablerow_close',array()),131 array('table_close',array(19)),132 array('p_open',array()),133 array('cdata',array('def')),134 array('p_close',array()),135 array('document_end',array()),136 );137 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));138 }139 function testTableHead() {140 $this->P->addMode('table',new Doku_Parser_Mode_Table());141 $this->P->parse('142abc143^ X ^ Y ^ Z ^144| x | y | z |145def');146 $calls = array (147 array('document_start',array()),148 array('p_open',array()),149 array('cdata',array("\n\nabc")),150 array('p_close',array()),151 array('table_open',array(3, 2, 6)),152 array('tablethead_open',array()),153 array('tablerow_open',array()),154 array('tableheader_open',array(1,NULL,1)),155 array('cdata',array(' X ')),156 array('tableheader_close',array()),157 array('tableheader_open',array(1,NULL,1)),158 array('cdata',array(' Y ')),159 array('tableheader_close',array()),160 array('tableheader_open',array(1,NULL,1)),161 array('cdata',array(' Z ')),162 array('tableheader_close',array()),163 array('tablerow_close',array()),164 array('tablethead_close',array()),165 array('tablerow_open',array()),166 array('tablecell_open',array(1,NULL,1)),167 array('cdata',array(' x ')),168 array('tablecell_close',array()),169 array('tablecell_open',array(1,NULL,1)),170 array('cdata',array(' y ')),171 array('tablecell_close',array()),172 array('tablecell_open',array(1,NULL,1)),173 array('cdata',array(' z ')),174 array('tablecell_close',array()),175 array('tablerow_close',array()),176 array('table_close',array(33)),177 array('p_open',array()),178 array('cdata',array('def')),179 array('p_close',array()),180 array('document_end',array()),181 );182 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));183 }184 function testTableHeadOneRowTable() {185 $this->P->addMode('table',new Doku_Parser_Mode_Table());186 $this->P->parse('187abc188^ X ^ Y ^ Z ^189def');190 $calls = array (191 array('document_start',array()),192 array('p_open',array()),193 array('cdata',array("\n\nabc")),194 array('p_close',array()),195 array('table_open',array(3, 1, 6)),196 array('tablerow_open',array()),197 array('tableheader_open',array(1,NULL,1)),198 array('cdata',array(' X ')),199 array('tableheader_close',array()),200 array('tableheader_open',array(1,NULL,1)),201 array('cdata',array(' Y ')),202 array('tableheader_close',array()),203 array('tableheader_open',array(1,NULL,1)),204 array('cdata',array(' Z ')),205 array('tableheader_close',array()),206 array('tablerow_close',array()),207 array('table_close',array(19)),208 array('p_open',array()),209 array('cdata',array('def')),210 array('p_close',array()),211 array('document_end',array()),212 );213 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));214 }215 function testTableHeadMultiline() {216 $this->P->addMode('table',new Doku_Parser_Mode_Table());217 $this->P->parse('218abc219^ X1 ^ Y1 ^ Z1 ^220^ X2 ^ Y2 ^ Z2 ^221| A | B | C |222def');223 $calls = array (224 array('document_start',array()),225 array('p_open',array()),226 array('cdata',array("\n\nabc")),227 array('p_close',array()),228 array('table_open',array(3, 3, 6)),229 array('tablethead_open',array()),230 array('tablerow_open',array()),231 array('tableheader_open',array(1,NULL,1)),232 array('cdata',array(' X1 ')),233 array('tableheader_close',array()),234 array('tableheader_open',array(1,NULL,1)),235 array('cdata',array(' Y1 ')),236 array('tableheader_close',array()),237 array('tableheader_open',array(1,NULL,1)),238 array('cdata',array(' Z1 ')),239 array('tableheader_close',array()),240 array('tablerow_close',array()),241 array('tablerow_open',array()),242 array('tableheader_open',array(1,NULL,1)),243 array('cdata',array(' X2 ')),244 array('tableheader_close',array()),245 array('tableheader_open',array(1,NULL,1)),246 array('cdata',array(' Y2 ')),247 array('tableheader_close',array()),248 array('tableheader_open',array(1,NULL,1)),249 array('cdata',array(' Z2 ')),250 array('tableheader_close',array()),251 array('tablerow_close',array()),252 array('tablethead_close',array()),253 array('tablerow_open',array()),254 array('tablecell_open',array(1,NULL,1)),255 array('cdata',array(' A ')),256 array('tablecell_close',array()),257 array('tablecell_open',array(1,NULL,1)),258 array('cdata',array(' B ')),259 array('tablecell_close',array()),260 array('tablecell_open',array(1,NULL,1)),261 array('cdata',array(' C ')),262 array('tablecell_close',array()),263 array('tablerow_close',array()),264 array('table_close',array(53)),265 array('p_open',array()),266 array('cdata',array('def')),267 array('p_close',array()),268 array('document_end',array()),269 );270 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));271 }272 function testCellAlignment() {273 $this->P->addMode('table',new Doku_Parser_Mode_Table());274 $this->P->parse('275abc276| X | Y ^ Z |277def');278 $calls = array (279 array('document_start',array()),280 array('p_open',array()),281 array('cdata',array("\n\nabc")),282 array('p_close',array()),283 array('table_open',array(3, 1, 6)),284 array('tablerow_open',array()),285 array('tablecell_open',array(1,'right',1)),286 array('cdata',array(' X ')),287 array('tablecell_close',array()),288 array('tablecell_open',array(1,'left',1)),289 array('cdata',array(' Y ')),290 array('tablecell_close',array()),291 array('tableheader_open',array(1,'center',1)),292 array('cdata',array(' Z ')),293 array('tableheader_close',array()),294 array('tablerow_close',array()),295 array('table_close',array(23)),296 array('p_open',array()),297 array('cdata',array('def')),298 array('p_close',array()),299 array('document_end',array()),300 );301 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));302 }303 function testCellSpan() {304 $this->P->addMode('table',new Doku_Parser_Mode_Table());305 $this->P->parse('306abc307| d || e |308| f ^ ^|309||||310def');311 $calls = array (312 array('document_start',array()),313 array('p_open',array()),314 array('cdata',array("\n\nabc")),315 array('p_close',array()),316 array('table_open',array(3, 3, 6)),317 array('tablerow_open',array()),318 array('tablecell_open',array(2,'right',1)),319 array('cdata',array(' d ')),320 array('tablecell_close',array()),321 array('tablecell_open',array(1,NULL,1)),322 array('cdata',array(' e ')),323 array('tablecell_close',array()),324 array('tablerow_close',array()),325 array('tablerow_open',array()),326 array('tablecell_open',array(1,NULL,1)),327 array('cdata',array(' f ')),328 array('tablecell_close',array()),329 array('tableheader_open',array(2,NULL,1)),330 array('cdata',array(' ')),331 array('tableheader_close',array()),332 array('tablerow_close',array()),333 array('tablerow_open',array()),334 array('tablerow_close',array()),335 array('table_close',array(31)),336 array('p_open',array()),337 array('cdata',array('def')),338 array('p_close',array()),339 array('document_end',array()),340 );341 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));342 }343 function testCellRowSpan() {344 $this->P->addMode('table',new Doku_Parser_Mode_Table());345 $this->P->parse('346abc347| a | c:::||348|:::^ d | e|349|b ^ ::: |:::f|350def');351 $calls = array (352 array('document_start',array()),353 array('p_open',array()),354 array('cdata',array("\n\nabc")),355 array('p_close',array()),356 array('table_open',array(3, 3, 6)),357 array('tablerow_open',array()),358 array('tablecell_open',array(1,NULL,2)),359 array('cdata',array(' a ')),360 array('tablecell_close',array()),361 array('tablecell_open',array(2,'right',1)),362 array('cdata',array(' c:::')),363 array('tablecell_close',array()),364 array('tablerow_close',array()),365 array('tablerow_open',array()),366 array('tableheader_open',array(1,'left',2)),367 array('cdata',array(' d ')),368 array('tableheader_close',array()),369 array('tablecell_open',array(1,NULL,1)),370 array('cdata',array(' e')),371 array('tablecell_close',array()),372 array('tablerow_close',array()),373 array('tablerow_open',array()),374 array('tablecell_open',array(1,'left',1)),375 array('cdata',array('b ')),376 array('tablecell_close',array()),377 array('tablecell_open',array(1,NULL,1)),378 array('cdata',array(':::f')),379 array('tablecell_close',array()),380 array('tablerow_close',array()),381 array('table_close',array(51)),382 array('p_open',array()),383 array('cdata',array('def')),384 array('p_close',array()),385 array('document_end',array()),386 );387 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));388 }389 function testCellRowSpanFirstRow() {390 $this->P->addMode('table',new Doku_Parser_Mode_Table());391 $this->P->parse('392abc393|::: ^ d:::^:::| ::: |394| b ^ e | | ::: |395|c ^ ::: | |:::|396def');397 $calls = array (398 array('document_start',array()),399 array('p_open',array()),400 array('cdata',array("\n\nabc")),401 array('p_close',array()),402 array('table_open',array(4, 3, 6)),403 array('tablerow_open',array()),404 array('tablecell_open',array(1,NULL,1)),405 array('cdata',array('')),406 array('tablecell_close',array()),407 array('tableheader_open',array(1,'right',1)),408 array('cdata',array(' d:::')),409 array('tableheader_close',array()),410 array('tableheader_open',array(1,NULL,1)),411 array('cdata',array('')),412 array('tableheader_close',array()),413 array('tablecell_open',array(1,NULL,3)),414 array('cdata',array('')),415 array('tablecell_close',array()),416 array('tablerow_close',array()),417 array('tablerow_open',array()),418 array('tablecell_open',array(1,NULL,1)),419 array('cdata',array(' b ')),420 array('tablecell_close',array()),421 array('tableheader_open',array(1,'left',2)),422 array('cdata',array(' e ')),423 array('tableheader_close',array()),424 array('tablecell_open',array(1,NULL,1)),425 array('cdata',array(' ')),426 array('tablecell_close',array()),427 array('tablerow_close',array()),428 array('tablerow_open',array()),429 array('tablecell_open',array(1,'left',1)),430 array('cdata',array('c ')),431 array('tablecell_close',array()),432 array('tablecell_open',array(1,NULL,1)),433 array('cdata',array(' ')),434 array('tablecell_close',array()),435 array('tablerow_close',array()),436 array('table_close',array(69)),437 array('p_open',array()),438 array('cdata',array('def')),439 array('p_close',array()),440 array('document_end',array()),441 );442 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));443 }444 function testRowSpanTableHead() {445 $this->P->addMode('table',new Doku_Parser_Mode_Table());446 $this->P->parse('447abc448^ X1 ^ Y1 ^ Z1 ^449^ X2 ^ ::: ^ Z2 ^450| A3 | B3 | C3 |451def');452 $calls = array (453 array('document_start',array()),454 array('p_open',array()),455 array('cdata',array("\n\nabc")),456 array('p_close',array()),457 array('table_open',array(3, 3, 6)),458 array('tablethead_open',array()),459 array('tablerow_open',array()),460 array('tableheader_open',array(1,NULL,1)),461 array('cdata',array(' X1 ')),462 array('tableheader_close',array()),463 array('tableheader_open',array(1,NULL,2)),464 array('cdata',array(' Y1 ')),465 array('tableheader_close',array()),466 array('tableheader_open',array(1,NULL,1)),467 array('cdata',array(' Z1 ')),468 array('tableheader_close',array()),469 array('tablerow_close',array()),470 array('tablerow_open',array()),471 array('tableheader_open',array(1,NULL,1)),472 array('cdata',array(' X2 ')),473 array('tableheader_close',array()),474 array('tableheader_open',array(1,NULL,1)),475 array('cdata',array(' Z2 ')),476 array('tableheader_close',array()),477 array('tablerow_close',array()),478 array('tablethead_close',array()),479 array('tablerow_open',array()),480 array('tablecell_open',array(1,NULL,1)),481 array('cdata',array(' A3 ')),482 array('tablecell_close',array()),483 array('tablecell_open',array(1,NULL,1)),484 array('cdata',array(' B3 ')),485 array('tablecell_close',array()),486 array('tablecell_open',array(1,NULL,1)),487 array('cdata',array(' C3 ')),488 array('tablecell_close',array()),489 array('tablerow_close',array()),490 array('table_close',array(57)),491 array('p_open',array()),492 array('cdata',array('def')),493 array('p_close',array()),494 array('document_end',array()),495 );496 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));497 }498 function testRowSpanAcrossTableHeadBoundary() {499 $this->P->addMode('table',new Doku_Parser_Mode_Table());500 $this->P->parse('501abc502^ X1 ^ Y1 ^ Z1 ^503^ X2 ^ ::: ^ Z2 ^504| A3 | ::: | C3 |505| A4 | ::: | C4 |506def');507 $calls = array (508 array('document_start',array()),509 array('p_open',array()),510 array('cdata',array("\n\nabc")),511 array('p_close',array()),512 array('table_open',array(3, 4, 6)),513 array('tablethead_open',array()),514 array('tablerow_open',array()),515 array('tableheader_open',array(1,NULL,1)),516 array('cdata',array(' X1 ')),517 array('tableheader_close',array()),518 array('tableheader_open',array(1,NULL,2)),519 array('cdata',array(' Y1 ')),520 array('tableheader_close',array()),521 array('tableheader_open',array(1,NULL,1)),522 array('cdata',array(' Z1 ')),523 array('tableheader_close',array()),524 array('tablerow_close',array()),525 array('tablerow_open',array()),526 array('tableheader_open',array(1,NULL,1)),527 array('cdata',array(' X2 ')),528 array('tableheader_close',array()),529 array('tableheader_open',array(1,NULL,1)),530 array('cdata',array(' Z2 ')),531 array('tableheader_close',array()),532 array('tablerow_close',array()),533 array('tablethead_close',array()),534 array('tablerow_open',array()),535 array('tablecell_open',array(1,NULL,1)),536 array('cdata',array(' A3 ')),537 array('tablecell_close',array()),538 array('tablecell_open',array(1,NULL,2)),539 array('cdata',array('')),540 array('tablecell_close',array()),541 array('tablecell_open',array(1,NULL,1)),542 array('cdata',array(' C3 ')),543 array('tablecell_close',array()),544 array('tablerow_close',array()),545 array('tablerow_open',array()),546 array('tablecell_open',array(1,NULL,1)),547 array('cdata',array(' A4 ')),548 array('tablecell_close',array()),549 array('tablecell_open',array(1,NULL,1)),550 array('cdata',array(' C4 ')),551 array('tablecell_close',array()),552 array('tablerow_close',array()),553 array('table_close',array(76)),554 array('p_open',array()),555 array('cdata',array('def')),556 array('p_close',array()),557 array('document_end',array()),558 );559 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));560 }561 function testCellAlignmentFormatting() {562 $this->P->addMode('table',new Doku_Parser_Mode_Table());563 $this->P->addMode('strong',new Doku_Parser_Mode_Formatting('strong'));564 $this->P->parse('565abc566| **X** | Y ^ Z |567def');568 $calls = array (569 array('document_start',array()),570 array('p_open',array()),571 array('cdata',array("\n\nabc")),572 array('p_close',array()),573 array('table_open',array(3, 1, 6)),574 array('tablerow_open',array()),575 array('tablecell_open',array(1,'right',1)),576 array('cdata',array(' ')),577 array('strong_open',array()),578 array('cdata',array('X')),579 array('strong_close',array()),580 array('cdata',array(' ')),581 array('tablecell_close',array()),582 array('tablecell_open',array(1,'left',1)),583 array('cdata',array(' Y ')),584 array('tablecell_close',array()),585 array('tableheader_open',array(1,'center',1)),586 array('cdata',array(' Z ')),587 array('tableheader_close',array()),588 array('tablerow_close',array()),589 array('table_close',array(27)),590 array('p_open',array()),591 array('cdata',array('def')),592 array('p_close',array()),593 array('document_end',array()),594 );595 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));596 }597 function testTableEol() {598 $this->P->addMode('table',new Doku_Parser_Mode_Table());599 $this->P->addMode('eol',new Doku_Parser_Mode_Eol());600 $this->P->parse('601abc602| Row 0 Col 1 | Row 0 Col 2 | Row 0 Col 3 |603| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |604def');605 $calls = array (606 array('document_start',array()),607 array('p_open',array()),608 array('cdata',array("abc")),609 array('p_close',array()),610 array('table_open',array(3, 2, 6)),611 array('tablerow_open',array()),612 array('tablecell_open',array(1,'left',1)),613 array('cdata',array(' Row 0 Col 1 ')),614 array('tablecell_close',array()),615 array('tablecell_open',array(1,'left',1)),616 array('cdata',array(' Row 0 Col 2 ')),617 array('tablecell_close',array()),618 array('tablecell_open',array(1,'left',1)),619 array('cdata',array(' Row 0 Col 3 ')),620 array('tablecell_close',array()),621 array('tablerow_close',array()),622 array('tablerow_open',array()),623 array('tablecell_open',array(1,'left',1)),624 array('cdata',array(' Row 1 Col 1 ')),625 array('tablecell_close',array()),626 array('tablecell_open',array(1,'left',1)),627 array('cdata',array(' Row 1 Col 2 ')),628 array('tablecell_close',array()),629 array('tablecell_open',array(1,'left',1)),630 array('cdata',array(' Row 1 Col 3 ')),631 array('tablecell_close',array()),632 array('tablerow_close',array()),633 array('table_close',array(121)),634 array('p_open',array()),635 array('cdata',array('def')),636 array('p_close',array()),637 array('document_end',array()),638 );639 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));640 }641 // This is really a failing test - formatting able to spread across cols642 // Problem is fixing it would mean a major rewrite of table handling643 function testTableStrong() {644 $this->P->addMode('table',new Doku_Parser_Mode_Table());645 $this->P->addMode('strong',new Doku_Parser_Mode_Formatting('strong'));646 $this->P->parse('647abc648| **Row 0 Col 1** | **Row 0 Col 2 | Row 0 Col 3** |649| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |650def');651 $calls = array (652 array('document_start',array()),653 array('p_open',array()),654 array('cdata',array("\n\nabc")),655 array('p_close',array()),656 array('table_open',array(3, 2, 6)),657 array('tablerow_open',array()),658 array('tablecell_open',array(1,'left',1)),659 array('cdata',array(' ')),660 array('strong_open',array()),661 array('cdata',array('Row 0 Col 1')),662 array('strong_close',array()),663 array('cdata',array(' ')),664 array('tablecell_close',array()),665 array('tablecell_open',array(1,'left',1)),666 array('cdata',array(' ')),667 array('strong_open',array()),668 array('cdata',array('Row 0 Col 2 | Row 0 Col 3')),669 array('strong_close',array()),670 array('cdata',array(' ')),671 array('tablecell_close',array()),672 array('tablecell_open',array(1,null,1)),673 array('cdata',array('')),674 array('tablecell_close',array()),675 array('tablerow_close',array()),676 array('tablerow_open',array()),677 array('tablecell_open',array(1,'left',1)),678 array('cdata',array(' Row 1 Col 1 ')),679 array('tablecell_close',array()),680 array('tablecell_open',array(1,'left',1)),681 array('cdata',array(' Row 1 Col 2 ')),682 array('tablecell_close',array()),683 array('tablecell_open',array(1,'left',1)),684 array('cdata',array(' Row 1 Col 3 ')),685 array('tablecell_close',array()),686 array('tablerow_close',array()),687 array('table_close',array(129)),688 array('p_open',array()),689 array('cdata',array('def')),690 array('p_close',array()),691 array('document_end',array()),692 );693 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));694 }695 // This is really a failing test - unformatted able to spread across cols696 // Problem is fixing it would mean a major rewrite of table handling697 function testTableUnformatted() {698 $this->P->addMode('table',new Doku_Parser_Mode_Table());699 $this->P->addMode('unformatted',new Doku_Parser_Mode_Unformatted());700 $this->P->parse('701abc702| <nowiki>Row 0 Col 1</nowiki> | <nowiki>Row 0 Col 2 | Row 0 Col 3</nowiki> |703| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |704def');705 $calls = array (706 array('document_start',array()),707 array('p_open',array()),708 array('cdata',array("\n\nabc")),709 array('p_close',array()),710 array('table_open',array(3, 2, 6)),711 array('tablerow_open',array()),712 array('tablecell_open',array(1,'left',1)),713 array('cdata',array(' ')),714 array('unformatted',array('Row 0 Col 1')),715 array('cdata',array(' ')),716 array('tablecell_close',array()),717 array('tablecell_open',array(1,'left',1)),718 array('cdata',array(' ')),719 array('unformatted',array('Row 0 Col 2 | Row 0 Col 3')),720 array('cdata',array(' ')),721 array('tablecell_close',array()),722 array('tablecell_open',array(1,null,1)),723 array('cdata',array('')),724 array('tablecell_close',array()),725 array('tablerow_close',array()),726 array('tablerow_open',array()),727 array('tablecell_open',array(1,'left',1)),728 array('cdata',array(' Row 1 Col 1 ')),729 array('tablecell_close',array()),730 array('tablecell_open',array(1,'left',1)),731 array('cdata',array(' Row 1 Col 2 ')),732 array('tablecell_close',array()),733 array('tablecell_open',array(1,'left',1)),734 array('cdata',array(' Row 1 Col 3 ')),735 array('tablecell_close',array()),736 array('tablerow_close',array()),737 array('table_close',array(155)),738 array('p_open',array()),739 array('cdata',array('def')),740 array('p_close',array()),741 array('document_end',array()),742 );743 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));744 }745 function testTableLinebreak() {746 $this->P->addMode('table',new Doku_Parser_Mode_Table());747 $this->P->addMode('linebreak',new Doku_Parser_Mode_Linebreak());748 $this->P->parse('749abc750| Row 0\\\\ Col 1 | Row 0 Col 2 | Row 0 Col 3 |751| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |752def');753 $calls = array (754 array('document_start',array()),755 array('p_open',array()),756 array('cdata',array("\n\nabc")),757 array('p_close',array()),758 array('table_open',array(3, 2, 6)),759 array('tablerow_open',array()),760 array('tablecell_open',array(1,'left',1)),761 array('cdata',array(' Row 0')),762 array('linebreak',array()),763 array('cdata',array('Col 1 ')),764 array('tablecell_close',array()),765 array('tablecell_open',array(1,'left',1)),766 array('cdata',array(' Row 0 Col 2 ')),767 array('tablecell_close',array()),768 array('tablecell_open',array(1,'left',1)),769 array('cdata',array(' Row 0 Col 3 ')),770 array('tablecell_close',array()),771 array('tablerow_close',array()),772 array('tablerow_open',array()),773 array('tablecell_open',array(1,'left',1)),774 array('cdata',array(' Row 1 Col 1 ')),775 array('tablecell_close',array()),776 array('tablecell_open',array(1,'left',1)),777 array('cdata',array(' Row 1 Col 2 ')),778 array('tablecell_close',array()),779 array('tablecell_open',array(1,'left',1)),780 array('cdata',array(' Row 1 Col 3 ')),781 array('tablecell_close',array()),782 array('tablerow_close',array()),783 array('table_close',array(123)),784 array('p_open',array()),785 array('cdata',array('def')),786 array('p_close',array()),787 array('document_end',array()),788 );789 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));790 }791 // This is really a failing test - footnote able to spread across cols792 // Problem is fixing it would mean a major rewrite of table handling793 function testTableFootnote() {794 $this->P->addMode('table',new Doku_Parser_Mode_Table());795 $this->P->addMode('footnote',new Doku_Parser_Mode_Footnote());796 $this->P->parse('797abc798| ((Row 0 Col 1)) | ((Row 0 Col 2 | Row 0 Col 3)) |799| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |800def');801 $calls = array (802 array('document_start',array()),803 array('p_open',array()),804 array('cdata',array("\n\nabc")),805 array('p_close',array()),806 array('table_open',array(3, 2, 6)),807 array('tablerow_open',array()),808 array('tablecell_open',array(1,'left',1)),809 array('cdata',array(' ')),810 array('nest', array ( array (811 array('footnote_open',array()),812 array('cdata',array('Row 0 Col 1')),813 array('footnote_close',array()),814 ))),815 array('cdata',array(' ')),816 array('tablecell_close',array()),817 array('tablecell_open',array(1,'left',1)),818 array('cdata',array(' ')),819 array('nest', array ( array (820 array('footnote_open',array()),821 array('cdata',array('Row 0 Col 2 | Row 0 Col 3')),822 array('footnote_close',array()),823 ))),824 array('cdata',array(' ')),825 array('tablecell_close',array()),826 array('tablecell_open',array(1,null,1)),827 array('cdata',array('')),828 array('tablecell_close',array()),829 array('tablerow_close',array()),830 array('tablerow_open',array()),831 array('tablecell_open',array(1,'left',1)),832 array('cdata',array(' Row 1 Col 1 ')),833 array('tablecell_close',array()),834 array('tablecell_open',array(1,'left',1)),835 array('cdata',array(' Row 1 Col 2 ')),836 array('tablecell_close',array()),837 array('tablecell_open',array(1,'left',1)),838 array('cdata',array(' Row 1 Col 3 ')),839 array('tablecell_close',array()),840 array('tablerow_close',array()),841 array('table_close',array(129)),842 array('p_open',array()),843 array('cdata',array('def')),844 array('p_close',array()),845 array('document_end',array()),846 );847 $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls));848 }849 function testTable_FS1833() {850 $syntax = " \n| Row 0 Col 1 |\n";851 $this->P->addMode('table',new Doku_Parser_Mode_Table());852 $this->P->parse($syntax);853 $calls = array (854 array('document_start',array()),855 array('table_open',array(1, 1, 2)),856 array('tablerow_open',array()),857 array('tablecell_open',array(1,'left',1)),858 array('cdata',array(' Row 0 Col 1 ')),859 array('tablecell_close',array()),860 array('tablerow_close',array()),861 array('table_close',array(strlen($syntax))),862 array('document_end',array()),863 );864 $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);865 }866 /**867 * missing cells in one row get filled up...868 */869 function testTable_CellFix() {870 $syntax = "\n| r1c1 | r1c2 | r1c3 |\n| r2c1 |\n";871 $this->P->addMode('table',new Doku_Parser_Mode_Table());872 $this->P->parse($syntax);873 $calls = array (874 array('document_start',array()),875 array('table_open',array(3, 2, 2)),876 array('tablerow_open',array()),877 array('tablecell_open',array(1,null,1)),878 array('cdata',array(' r1c1 ')),879 array('tablecell_close',array()),880 array('tablecell_open',array(1,null,1)),881 array('cdata',array(' r1c2 ')),882 array('tablecell_close',array()),883 array('tablecell_open',array(1,null,1)),884 array('cdata',array(' r1c3 ')),885 array('tablecell_close',array()),886 array('tablerow_close',array()),887 array('tablerow_open',array()),888 array('tablecell_open',array(1,null,1)),889 array('cdata',array(' r2c1 ')),890 array('tablecell_close',array()),891 array('tablecell_open',array(1,null,1)),892 array('cdata',array('')),893 array('tablecell_close',array()),894 array('tablecell_open',array(1,null,1)),895 array('cdata',array('')),896 array('tablecell_close',array()),897 array('tablerow_close',array()),898 array('table_close',array(strlen($syntax))),899 array('document_end',array()),900 );901 $this->assertEquals($calls, array_map('stripbyteindex',$this->H->calls));902 }903 /**904 * ... even if the longer row comes later905 */906 function testTable_CellFix2() {907 $syntax = "\n| r1c1 |\n| r2c1 | r2c2 | r2c3 |\n";908 $this->P->addMode('table',new Doku_Parser_Mode_Table());909 $this->P->parse($syntax);910 $calls = array (911 array('document_start',array()),912 array('table_open',array(3, 2, 2)),913 array('tablerow_open',array()),914 array('tablecell_open',array(1,null,1)),915 array('cdata',array(' r1c1 ')),916 array('tablecell_close',array()),917 array('tablecell_open',array(1,null,1)),918 array('cdata',array('')),919 array('tablecell_close',array()),920 array('tablecell_open',array(1,null,1)),921 array('cdata',array('')),922 array('tablecell_close',array()),923 array('tablerow_close',array()),924 array('tablerow_open',array()),925 array('tablecell_open',array(1,null,1)),926 array('cdata',array(' r2c1 ')),927 array('tablecell_close',array()),928 array('tablecell_open',array(1,null,1)),929 array('cdata',array(' r2c2 ')),930 array('tablecell_close',array()),931 array('tablecell_open',array(1,null,1)),932 array('cdata',array(' r2c3 ')),933 array('tablecell_close',array()),934 array('tablerow_close',array()),935 array('table_close',array(strlen($syntax))),936 array('document_end',array()),937 );938 $this->assertEquals($calls, array_map('stripbyteindex',$this->H->calls));939 }940}...
get_info_from_file.php
Source:get_info_from_file.php
1<?php2$target_file = "s03_1.btxt";3$first_head = true;4function make_s03_1 ($source_path){5global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;6 7$file_stored = fopen( $source_path , 'r') or exit("Unable to open $source_path");8echo $source_path . "<br />";9$isbody = false;10$istable = false;11$tablerow = -1; // 0. a fejléc esetleg 1. is, ezért és 6-ig számolok12$newstring = "";13while(!feof($file_stored)){14if ( $tablerow < 7 ) {15 if ( $isbody ){16 if ( $istable ){17 echo $newstring;18 // fwrite ( $file_s03_1 , $newstring );19 $pos = strpos( $newstring , "<td");20 if ( $pos !== false ) {21 $pos = strpos( $newstring , ">");22 $newstring = substr ($newstring, $pos + 1);23 $pos = strpos( $newstring , "</td></tr>");24 $newstring = substr ($newstring, 0, $pos );25 //array_push ( $tablecell[$tablerow] , $newstring );26 $newline = explode("</td><td>", $newstring);27 $tablecell[$tablerow] = $newline;28 }else{29 $pos = strpos( $newstring , "<th");30 if ( $pos !== false ) {31 $pos = strpos( $newstring , ">");32 $newstring = substr ($newstring, $pos + 1);33 $pos = strpos( $newstring , "<");34 $newstring = substr ($newstring, 0, $pos );35 array_push ( $tablecell[$tablerow] , $newstring );36 }37 }38 } else {39 $pos = strpos( $newstring , "<p");40 if ( $pos !== false ) {41 echo $newstring;42 // fwrite ( $file_s03_1 , $newstring );43 array_push ( $paragraph , $newstring );44 }45 $pos = strpos( $newstring , "<table");46 if ( $pos !== false ) {47 echo $newstring;48 $istable = true;49 // fwrite ( $file_s03_1 , $newstring );50 }51 }52 } else {53 if ( $first_head ){54 echo $newstring;55 }56 $startpos = 0;57 $pos = strpos( $newstring , "<body" , $startpos);58 if ( $pos !== false ) {59 $isbody = true;60 }61 }62} else {63 echo "</table><br /><br />";64 // fwrite ( $file_s03_1 , "</table><br /><br /> \n" );65 break;66} 67$newstring = fgets ($file_stored);68$pos = strpos( $newstring , "<tr");69if ( $pos !== false ) {70 $tablerow++;71 }72}73fclose($file_stored);74print_r ( $paragraph );75echo '<br />';76print_r ( $tablecell );77 78}79//-------------------------------------------------------------------80function lotto5(){81 82global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;83 echo '<br /><br /> function_exists' . '<br />';84fwrite( $file_s03_1 , '<p class="onecolumn"><b> Ãtös lottó : </b><br />' . "\n");85echo '5-ös lottó - <br />';86for ($y = 11; $y < 15 ; $y++) {87fwrite( $file_s03_1 , $tablecell[1][$y] . ',' . "\n");88 }89fwrite( $file_s03_1 , $tablecell[1][15] . '</p>' . "\n");90fwrite( $file_s03_1 , '<div id="more-lotto5">');91fwrite( $file_s03_1 , '<a onclick="show(\'less-lotto5\'); hide(\'more-lotto5\')" >' . "\n"); 92fwrite( $file_s03_1 , '<p class="showline">Mutass többet!</p></a>' . "\n"); 93fwrite( $file_s03_1 , '</div>' . "\n");94fwrite( $file_s03_1 , '<div id="less-lotto5" style="display: none; background-color: lightgray">');95fwrite( $file_s03_1 , '<a onclick="show(\'more-lotto5\'); hide(\'less-lotto5\')" >' . "\n"); 96fwrite( $file_s03_1 , '<p class="showline">Rejtsd el!</p></a>' . "\n"); 97 for ($x = 1; $x < 6 ; $x++) {98fwrite( $file_s03_1 , '<p class="onecolumn">' . "\n"); 99fwrite( $file_s03_1 , '<u>A ' . $tablecell[$x][0] . '.év ');100fwrite( $file_s03_1 , $tablecell[$x][1] . '.hét ( ');101fwrite( $file_s03_1 , $tablecell[$x][2] . ' )</u><br />' . "\n");102fwrite( $file_s03_1 , '<i>- eredményei: ' . "\n");103 for ($y = 11; $y < 15 ; $y++) {104fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");105 }106fwrite( $file_s03_1 , $tablecell[$x][15] . '<br />' . "\n");107fwrite( $file_s03_1 , '- nyereményei: ' . "\n");108fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">5 találat ' . $tablecell[$x][4] . " ( \n");109fwrite( $file_s03_1 , $tablecell[$x][3] . ' db );</span> ' . "\n");110fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">4 találat ' . $tablecell[$x][6] . " ( \n");111fwrite( $file_s03_1 , $tablecell[$x][5] . ' db );</span> ' . "\n");112fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">3 találat ' . $tablecell[$x][8] . " ( \n");113fwrite( $file_s03_1 , $tablecell[$x][7] . ' db );</span> ' . "\n");114fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">2 találat ' . $tablecell[$x][10] . " ( \n");115fwrite( $file_s03_1 , $tablecell[$x][9] . ' db ).</span> ' . "\n");116echo $tablecell[$x][0] . '/' . $tablecell[$x][1] . '/' . $tablecell[$x][2] . '<br />';117fwrite( $file_s03_1 , '</i></p>' . "\n");118 if ( $x == 1 ) {119 }120 }121fwrite( $file_s03_1 , '</p></div>' . "\n");122}123//-------------------------------------------------------------------124function lotto6(){125 126global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;127 echo '<br /><br /> function_exists' . '<br />';128fwrite( $file_s03_1 , '<p class="onecolumn"><b> Hatos lottó : </b><br />' . "\n");129echo '6-os lottó - <br />';130 for ($y = 13; $y < 18 ; $y++) {131fwrite( $file_s03_1 , $tablecell[1][$y] . ',' . "\n");132 }133fwrite( $file_s03_1 , $tablecell[1][18] . '</p>' . "\n");134fwrite( $file_s03_1 , '<div id="more-lotto6">');135fwrite( $file_s03_1 , '<a onclick="show(\'less-lotto6\'); hide(\'more-lotto6\')" >' . "\n"); 136fwrite( $file_s03_1 , '<p class="showline">Mutass többet!</p></a>' . "\n"); 137fwrite( $file_s03_1 , '</div>' . "\n");138fwrite( $file_s03_1 , '<div id="less-lotto6" style="display: none; background-color: lightgray">');139fwrite( $file_s03_1 , '<a onclick="show(\'more-lotto6\'); hide(\'less-lotto6\')" >' . "\n"); 140fwrite( $file_s03_1 , '<p class="showline">Rejtsd el!</p></a>' . "\n"); 141 for ($x = 1; $x < 6 ; $x++) {142 fwrite( $file_s03_1 , '<p class="onecolumn">' . "\n"); 143fwrite( $file_s03_1 , '<u>A ' . $tablecell[$x][0] . '.év ');144fwrite( $file_s03_1 , $tablecell[$x][1] . '.hét ( ');145fwrite( $file_s03_1 , $tablecell[$x][2] . ' )</u><br />' . "\n");146fwrite( $file_s03_1 , '<i>- eredményei: ' . "\n");147 for ($y = 13; $y < 18 ; $y++) {148fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");149 }150fwrite( $file_s03_1 , $tablecell[$x][18] . '<br />' . "\n");151fwrite( $file_s03_1 , '- nyereményei: ' . "\n");152fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">6 találat ' . $tablecell[$x][4] . " ( \n");153fwrite( $file_s03_1 , $tablecell[$x][3] . ' db );</span> ' . "\n");154fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">5+1 találat ' . $tablecell[$x][6] . " ( \n");155fwrite( $file_s03_1 , $tablecell[$x][5] . ' db );</span> ' . "\n");156fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">5 találat ' . $tablecell[$x][8] . " ( \n");157fwrite( $file_s03_1 , $tablecell[$x][7] . ' db );</span> ' . "\n");158fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">4 találat ' . $tablecell[$x][10] . " ( \n");159fwrite( $file_s03_1 , $tablecell[$x][9] . ' db );</span> ' . "\n");160fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">3 találat ' . $tablecell[$x][12] . " ( \n");161fwrite( $file_s03_1 , $tablecell[$x][11] . ' db ).</span> ' . "\n");162echo $tablecell[$x][0] . '/' . $tablecell[$x][1] . '/' . $tablecell[$x][2] . '<br />';163fwrite( $file_s03_1 , '</i></p>' . "\n");164 if ( $x == 1 ) {165 }166 }167fwrite( $file_s03_1 , '</p></div>' . "\n");168}169//-------------------------------------------------------------------170function lotto7(){171 172global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;173 echo '<br /><br /> function_exists' . '<br />';174fwrite( $file_s03_1 , '<p class="onecolumn"><b> Skandináv lottó : </b><br />' . "\n");175echo 'Skandináv lottó - <br />';176fwrite( $file_s03_1 , '<i>- gépi húzás: ' . "\n");177 for ($y = 11; $y < 17 ; $y++) {178fwrite( $file_s03_1 , $tablecell[2][$y] . ',' . "\n");179 }180fwrite( $file_s03_1 , $tablecell[2][17] . '<br />' . "\n");181fwrite( $file_s03_1 , '<i>- kézi húzás: ' . "\n");182 for ($y = 18; $y < 24 ; $y++) {183fwrite( $file_s03_1 , $tablecell[2][$y] . ',' . "\n");184 }185fwrite( $file_s03_1 , $tablecell[2][24] . '</p>' . "\n");186fwrite( $file_s03_1 , '<div id="more-lotto7">');187fwrite( $file_s03_1 , '<a onclick="show(\'less-lotto7\'); hide(\'more-lotto7\')" >' . "\n"); 188fwrite( $file_s03_1 , '<p class="showline">Mutass többet!</p></a>' . "\n"); 189fwrite( $file_s03_1 , '</div>' . "\n");190fwrite( $file_s03_1 , '<div id="less-lotto7" style="display: none; background-color: lightgray">');191fwrite( $file_s03_1 , '<a onclick="show(\'more-lotto7\'); hide(\'less-lotto7\')" >' . "\n"); 192fwrite( $file_s03_1 , '<p class="showline">Rejtsd el!</p></a>' . "\n"); 193 for ($x = 2; $x < 7 ; $x++) {194fwrite( $file_s03_1 , '<p class="onecolumn">' . "\n"); 195fwrite( $file_s03_1 , '<u>A ' . $tablecell[$x][0] . '.év ');196fwrite( $file_s03_1 , $tablecell[$x][1] . '.hét ( ');197fwrite( $file_s03_1 , $tablecell[$x][2] . ' )</u><br />' . "\n");198fwrite( $file_s03_1 , '<i>- gépi húzás: ' . "\n");199 for ($y = 11; $y < 17 ; $y++) {200fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");201 }202fwrite( $file_s03_1 , $tablecell[$x][17] . '<br />' . "\n");203fwrite( $file_s03_1 , '<i>- kézi húzás: ' . "\n");204 for ($y = 18; $y < 24 ; $y++) {205fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");206 }207fwrite( $file_s03_1 , $tablecell[$x][24] . '<br />' . "\n");208fwrite( $file_s03_1 , '- nyereményei: ' . "\n");209fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">7 találat ' . $tablecell[$x][4] . " ( \n");210fwrite( $file_s03_1 , $tablecell[$x][3] . ' db );</span> ' . "\n");211fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">6 találat ' . $tablecell[$x][6] . " ( \n");212fwrite( $file_s03_1 , $tablecell[$x][5] . ' db );</span> ' . "\n");213fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">5 találat ' . $tablecell[$x][8] . " ( \n");214fwrite( $file_s03_1 , $tablecell[$x][7] . ' db );</span> ' . "\n");215fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">4 találat ' . $tablecell[$x][10] . " ( \n");216fwrite( $file_s03_1 , $tablecell[$x][9] . ' db );</span> ' . "\n");217echo $tablecell[$x][0] . '/' . $tablecell[$x][1] . '/' . $tablecell[$x][2] . '<br />';218fwrite( $file_s03_1 , '</i></p>' . "\n");219 if ( $x == 2 ) {220 }221 }222fwrite( $file_s03_1 , '</p></div>' . "\n");223}224//-------------------------------------------------------------------225function goltoto(){226 227global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;228 echo '<br /><br /> function_exists' . '<br />';229fwrite( $file_s03_1 , '<p class="onecolumn"><b> Góltotó : </b><br />' . "\n");230echo 'Góltotó - <br />';231 for ($y = 10; $y < 23 ; $y++) {232fwrite( $file_s03_1 , $tablecell[1][$y] . ',' . "\n");233 }234fwrite( $file_s03_1 , $tablecell[1][23] . '</p>' . "\n");235fwrite( $file_s03_1 , '<div id="more-goltoto">');236fwrite( $file_s03_1 , '<a onclick="show(\'less-goltoto\'); hide(\'more-goltoto\')" >' . "\n"); 237fwrite( $file_s03_1 , '<p class="showline">Mutass többet!</p></a>' . "\n"); 238fwrite( $file_s03_1 , '</div>' . "\n");239fwrite( $file_s03_1 , '<div id="less-goltoto" style="display: none; background-color: lightgray">');240fwrite( $file_s03_1 , '<a onclick="show(\'more-goltoto\'); hide(\'less-goltoto\')" >' . "\n"); 241fwrite( $file_s03_1 , '<p class="showline">Rejtsd el!</p></a>' . "\n"); 242 for ($x = 1; $x < 6 ; $x++) {243fwrite( $file_s03_1 , '<p class="onecolumn">' . "\n"); 244fwrite( $file_s03_1 , '<u>A ' . $tablecell[$x][0] . '.év ');245fwrite( $file_s03_1 , $tablecell[$x][1] . '.hét ');246fwrite( $file_s03_1 , $tablecell[$x][2] . '.forduló</u><br />' . "\n");247fwrite( $file_s03_1 , '<i>- eredményei: ' . "\n");248 for ($y = 10; $y < 23 ; $y++) {249fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");250 }251fwrite( $file_s03_1 , $tablecell[$x][23] . '<br />' . "\n");252fwrite( $file_s03_1 , '- nyereményei: ' . "\n");253fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">6 találat ' . $tablecell[$x][5] . " ( \n");254fwrite( $file_s03_1 , $tablecell[$x][4] . ' db );</span> ' . "\n");255fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">5 találat ' . $tablecell[$x][7] . " ( \n");256fwrite( $file_s03_1 , $tablecell[$x][6] . ' db );</span> ' . "\n");257fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">4 találat ' . $tablecell[$x][9] . " ( \n");258fwrite( $file_s03_1 , $tablecell[$x][8] . ' db ).</span> ' . "\n");259echo $tablecell[$x][0] . '/' . $tablecell[$x][1] . '/' . $tablecell[$x][2] . '<br />';260fwrite( $file_s03_1 , '</i></p>' . "\n");261 if ( $x == 1 ) {262 }263 }264fwrite( $file_s03_1 , '</p></div>' . "\n");265}//-------------------------------------------------------------------266function toto(){267 268global $target_file, $file_s03_1, $first_head, $tablecell, $paragraph;269 echo '<br /><br /> function_exists' . '<br />';270fwrite( $file_s03_1 , '<p class="onecolumn"><b> Totó 13+1 : </b><br />' . "\n");271echo 'Totó - <br />';272 for ($y = 14; $y < 28 ; $y++) {273fwrite( $file_s03_1 , $tablecell[1][$y] . ',' . "\n");274 }275fwrite( $file_s03_1 , $tablecell[1][28] . '</p>' . "\n");276fwrite( $file_s03_1 , '<div id="more-toto">');277fwrite( $file_s03_1 , '<a onclick="show(\'less-toto\'); hide(\'more-toto\')" >' . "\n"); 278fwrite( $file_s03_1 , '<p class="showline">Mutass többet!</p></a>' . "\n"); 279fwrite( $file_s03_1 , '</div>' . "\n");280fwrite( $file_s03_1 , '<div id="less-toto" style="display: none; background-color: lightgray">');281fwrite( $file_s03_1 , '<a onclick="show(\'more-toto\'); hide(\'less-toto\')" >' . "\n"); 282fwrite( $file_s03_1 , '<p class="showline">Rejtsd el!</p></a>' . "\n"); 283 for ($x = 1; $x < 6 ; $x++) {284fwrite( $file_s03_1 , '<p class="onecolumn">' . "\n"); 285fwrite( $file_s03_1 , '<u>A ' . $tablecell[$x][0] . '.év ');286fwrite( $file_s03_1 , $tablecell[$x][1] . '.hét ');287fwrite( $file_s03_1 , $tablecell[$x][2] . '.forduló</u><br />' . "\n");288fwrite( $file_s03_1 , '<i>- eredményei: ' . "\n");289 for ($y = 14; $y < 28 ; $y++) {290fwrite( $file_s03_1 , $tablecell[$x][$y] . '|' . "\n");291 }292fwrite( $file_s03_1 , $tablecell[$x][28] . '<br />' . "\n");293fwrite( $file_s03_1 , '- nyereményei: ' . "\n");294fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">13+1 találat ' . $tablecell[$x][5] . " ( \n");295fwrite( $file_s03_1 , $tablecell[$x][4] . ' db );</span> ' . "\n");296fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">13 találat ' . $tablecell[$x][7] . " ( \n");297fwrite( $file_s03_1 , $tablecell[$x][6] . ' db );</span> ' . "\n");298fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">12 találat ' . $tablecell[$x][9] . " ( \n");299fwrite( $file_s03_1 , $tablecell[$x][8] . ' db );</span> ' . "\n");300fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">11 találat ' . $tablecell[$x][11] . " ( \n");301fwrite( $file_s03_1 , $tablecell[$x][10] . ' db );</span> ' . "\n");302fwrite( $file_s03_1 , '<span style=" white-space: nowrap;">10 találat ' . $tablecell[$x][13] . " ( \n");303fwrite( $file_s03_1 , $tablecell[$x][12] . ' db ).</span> ' . "\n");304echo $tablecell[$x][0] . '/' . $tablecell[$x][1] . '/' . $tablecell[$x][2] . '<br />';305fwrite( $file_s03_1 , '</i></p>' . "\n");306 if ( $x == 1 ) {307 }308 }309fwrite( $file_s03_1 , '</p></div>' . "\n");310}311//--------------------------------------------------------------------312$file_s03_1 = fopen( $target_file , 'w') or exit("Unable to open $target_file");313fwrite( $file_s03_1 , '<div class="parabellum">' . "\n");314$paragraph = array();315$tablecell = array( array () , array() , array() , array() , array() , array() );316$datafile = "data_lotto5.btxt";317make_s03_1( $datafile );318lotto5();319$first_head = false;320unset($paragraph);321$paragraph = array();322unset($tablecell);323$tablecell = array( array () , array() , array() , array() , array() , array() );324$datafile = "data_lotto6.btxt";325make_s03_1( $datafile );326lotto6();327unset($paragraph);328$paragraph = array();329unset($tablecell);330$tablecell = array( array () , array() , array() , array() , array() , array() , array() );331$datafile = "data_lotto7.btxt";332make_s03_1( $datafile );333lotto7();334unset($paragraph);335$paragraph = array();336unset($tablecell);337$tablecell = array( array () , array() , array() , array() , array() , array() );338$datafile = "data_toto.btxt";339make_s03_1( $datafile );340toto();341unset($paragraph);342$paragraph = array();343unset($tablecell);344$tablecell = array( array () , array() , array() , array() , array() , array() );345$datafile = "data_totogol.btxt";346make_s03_1( $datafile );347goltoto();348//unset($paragraph);349//$paragraph = array();350//unset($tablecell);351//$tablecell = array( array () , array() , array() , array() , array() , array() );352//$datafile = "data_luxor.btxt";353//make_s03_1( $datafile );354//unset($paragraph);355//$paragraph = array();356//unset($tablecell);357//$tablecell = array( array () , array() , array() , array() , array() , array() );358//$datafile = "data_keno.btxt";359//make_s03_1( $datafile );360//unset($paragraph);361//$paragraph = array();362//unset($tablecell);363//$tablecell = array( array () , array() , array() , array() , array() , array() );364//$datafile = "data_joker.btxt";365//make_s03_1( $datafile );366//unset($paragraph);367//$paragraph = array();368//unset($tablecell);369//$tablecell = array( array () , array() , array() , array() , array() , array() );370//$datafile = "data_eurojackpot.btxt";371//make_s03_1( $datafile );372unset($paragraph);373// $paragraph = array();374unset($tablecell);375// $tablecell = array( array () , array() , array() , array() , array() , array() );376$aktualtimestamp = time() ;377$ahetnapjai = array ( "vasárnap","hétfÅ","kedd","szerda","csütörtök","péntek","szombat");378$todayDate = date("Y.m.d., ", $aktualtimestamp);379$today = $ahetnapjai [ date( "w", $aktualtimestamp) ];380$todayTime = date(" H:i ", $aktualtimestamp);381$todayDateTime = $todayDate . $today . $todayTime;382fwrite( $file_s03_1 , '<br />' . "\n");383fwrite( $file_s03_1 , '<br /></p><p class="headfoot" align="right">');384fwrite( $file_s03_1 , 'A Szerencsejáték Zrt. tájékoztatása alapján ' . $todayDateTime );385fwrite( $file_s03_1 , '</p></div>' . "\n");386fclose($file_s03_1);387?>...
TableCell
Using AI Code Generation
1use Cucumber\Step\TableCell;2use Cucumber\Step\Table;3use Cucumber\Step\Row;4use Cucumber\Step\Step;5use Cucumber\Step\StepDefinition;6use Cucumber\Step\StepDefinitionInterface;7use Cucumber\Step\StepDefinitionFactory;8use Cucumber\Step\StepDefinitionFactoryInterface;9use Cucumber\Step\StepDefinitionLoader;10use Cucumber\Step\StepDefinitionLoaderInterface;11use Cucumber\Step\StepDefinitionLoaderFactory;12use Cucumber\Step\StepDefinitionLoaderFactoryInterface;13use Cucumber\Step\StepDefinitionLoaderRegistry;14use Cucumber\Step\StepDefinitionLoaderRegistryInterface;15use Cucumber\Step\StepDefinitionRegistry;16use Cucumber\Step\StepDefinitionRegistryInterface;17use Cucumber\Step\StepInterface;18use Cucumber\Step\StepRegistry;19use Cucumber\Step\StepRegistryInterface;20use Cucumber\Step\StepFactory;21use Cucumber\Step\StepFactoryInterface;22use Cucumber\Step\StepRegistryFactory;23use Cucumber\Step\StepRegistryFactoryInterface;24use Cucumber\Step\StepLoader;25use Cucumber\Step\StepLoaderInterface;26use Cucumber\Step\StepLoaderFactory;
TableCell
Using AI Code Generation
1$cell = new TableCell();2$cell->setCellText('Hello World');3$cell->setCellWidth(20);4$cell->setCellHeight(20);5$cell->setCellBgColor('red');6$cell->setCellTextColor('white');7$cell->setCellFontSize(12);8$cell->setCellFontStyle('bold');9$cell->setCellFontFamily('arial');10$cell->setCellAlign('center');11$cell->setCellVAlign('middle');12$cell->setCellBorder(1);13$cell->setCellBorderColor('black');14$cell->setCellBorderType('solid');15$cell->setCellPadding(0);16$cell->setCellMargin(0);17$row = new TableRow();18$row->addCell($cell);19$row->addCell($cell);20$row->addCell($cell);21$table = new Table();22$table->addRow($row);23$table->addRow($row);24$table->addRow($row);25$table->setTableWidth(100);26$table->setTableHeight(100);27$table->setTableBgColor('white');28$table->setTableBorder(1);29$table->setTableBorderColor('black');30$table->setTableBorderType('solid');31$table->setTablePadding(0);32$table->setTableMargin(0);33$table->setTableAlign('center');34$table->setTableVAlign('middle');35$table->setTableText('Hello World');36$table->setTableTextColor('black');37$table->setTableFontSize(12);38$table->setTableFontStyle('bold');39$table->setTableFontFamily('arial');40$table->setTableTextAlign('center');41$table->setTableTextVAlign('middle');42$table->setTableTextBgColor('white');43$table->setTableTextPadding(0);44$table->setTableTextMargin(0);45$table->setTableTextBorder(1);46$table->setTableTextBorderColor('black');47$table->setTableTextBorderType('solid');48$para = new P();49$para->setPText('Hello World');50$para->setPWidth(100);51$para->setPHeight(100);52$para->setPTextAlign('center');53$para->setPTextVAlign('middle');
TableCell
Using AI Code Generation
1require_once('cucumber-common-lib.php');2$cell = new TableCell();3$cell->setCell('Cell Value');4$cell->setCell('Cell Value 2');5$cell->setCell('Cell Value 3');6$cell->setCell('Cell Value 4');7$cell->setCell('Cell Value 5');8$cell->setCell('Cell Value 6');9$cell->setCell('Cell Value 7');10$cell->setCell('Cell Value 8');11$cell->setCell('Cell Value 9');12$cell->setCell('Cell Value 10');13$cell->setCell('Cell Value 11');14$cell->setCell('Cell Value 12');15$cell->setCell('Cell Value 13');16$cell->setCell('Cell Value 14');17$cell->setCell('Cell Value 15');18$cell->setCell('Cell Value 16');19$cell->setCell('Cell Value 17');20$cell->setCell('Cell Value 18');21$cell->setCell('Cell Value 19');22$cell->setCell('Cell Value 20');23$cell->setCell('Cell Value 21');24$cell->setCell('Cell Value 22');25$cell->setCell('Cell Value 23');26$cell->setCell('Cell Value 24');27$cell->setCell('Cell Value 25');28$cell->setCell('Cell Value 26');29$cell->setCell('Cell Value 27');30$cell->setCell('Cell Value 28');31$cell->setCell('Cell Value 29');32$cell->setCell('Cell Value 30');33$cell->setCell('Cell Value 31');34$cell->setCell('Cell Value 32');35$cell->setCell('Cell Value 33');36$cell->setCell('Cell Value 34');37$cell->setCell('Cell Value 35');38$cell->setCell('Cell Value 36');39$cell->setCell('Cell Value 37');40$cell->setCell('Cell Value 38');41$cell->setCell('Cell Value 39');42$cell->setCell('Cell Value 40');43$cell->setCell('Cell Value 41');44$cell->setCell('Cell Value 42');45$cell->setCell('Cell Value 43');46$cell->setCell('Cell Value 44');
TableCell
Using AI Code Generation
1include_once('CucumberCommonLibrary/TableCell.php');2$TableCell = new TableCell();3$TableCell->getTableCell();4$TableCell->setTableCell();5$TableCell->getTableCell();6$TableCell->setTableCell();7$TableCell->getTableCell();8$TableCell->setTableCell();9$TableCell->getTableCell();10$TableCell->setTableCell();11$TableCell->getTableCell();12$TableCell->setTableCell();13$TableCell->getTableCell();14$TableCell->setTableCell();15$TableCell->getTableCell();16$TableCell->setTableCell();17$TableCell->getTableCell();18$TableCell->setTableCell();19$TableCell->getTableCell();20$TableCell->setTableCell();21$TableCell->getTableCell();22$TableCell->setTableCell();23$TableCell->getTableCell();24$TableCell->setTableCell();25$TableCell->getTableCell();26$TableCell->setTableCell();
TableCell
Using AI Code Generation
1require_once 'CucumberCommonLibrary.php';2use Cucumber\CommonLibrary\TableCell;3$cell = new TableCell('2');4$cell->setValue('3');5$value = $cell->getValue();6$string = $cell->toString();7$json = $cell->toJson();8$array = $cell->toArray();9$xml = $cell->toXml();10$yaml = $cell->toYaml();11$serialized = $cell->toSerialized();12$csv = $cell->toCsv();13$html = $cell->toHtml();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!