You are here

public function TokenizerTest::assertEventEquals in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php \Masterminds\HTML5\Tests\Parser\TokenizerTest::assertEventEquals()

Tests that an event matches both the event type and the expected value.

Parameters

string $type: Expected event type.

string $expects: The value expected in $event['data'][0].

13 calls to TokenizerTest::assertEventEquals()
TokenizerTest::isAllGood in vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php
Asserts that all of the tests are good.
TokenizerTest::testBogusComment in vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php
TokenizerTest::testComment in vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php
TokenizerTest::testDoctype in vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php
TokenizerTest::testEndTag in vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php

... See full list

File

vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php, line 22

Class

TokenizerTest

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function assertEventEquals($type, $expects, $event) {
  $this
    ->assertEquals($type, $event['name'], "Event {$type} for " . print_r($event, true));
  if (is_array($expects)) {
    $this
      ->assertEquals($expects, $event['data'], "Event {$type} should equal " . print_r($expects, true) . ": " . print_r($event, true));
  }
  else {
    $this
      ->assertEquals($expects, $event['data'][0], "Event {$type} should equal {$expects}: " . print_r($event, true));
  }
}