ParserTestResult.php 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @file
  4. *
  5. * @copyright Copyright © 2013, Antoine Musso
  6. * @copyright Copyright © 2013, Wikimedia Foundation Inc.
  7. */
  8. /**
  9. * Represent the result of a parser test.
  10. *
  11. * @since 1.22
  12. */
  13. class ParserTestResult {
  14. /**
  15. * Description of the parser test.
  16. *
  17. * This is usually the text used to describe a parser test in the .txt
  18. * files. It is initialized on a construction and you most probably
  19. * never want to change it.
  20. */
  21. public $description;
  22. /** Text that was expected */
  23. public $expected;
  24. /** Actual text rendered */
  25. public $actual;
  26. /**
  27. * @param string $description A short text describing the parser test
  28. * usually the text in the parser test .txt file. The description
  29. * is later available using the property $description.
  30. */
  31. public function __construct( $description ) {
  32. $this->description = $description;
  33. }
  34. /**
  35. * Whether the test passed
  36. * @return bool
  37. */
  38. public function isSuccess() {
  39. return $this->expected === $this->actual;
  40. }
  41. }