WizardTest.php 956 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of code-unit-reverse-lookup.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace SebastianBergmann\CodeUnitReverseLookup;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * @covers SebastianBergmann\CodeUnitReverseLookup\Wizard
  14. */
  15. class WizardTest extends TestCase
  16. {
  17. /**
  18. * @var Wizard
  19. */
  20. private $wizard;
  21. protected function setUp()
  22. {
  23. $this->wizard = new Wizard;
  24. }
  25. public function testMethodCanBeLookedUp()
  26. {
  27. $this->assertEquals(
  28. __METHOD__,
  29. $this->wizard->lookup(__FILE__, __LINE__)
  30. );
  31. }
  32. public function testReturnsFilenameAndLineNumberAsStringWhenNotInCodeUnit()
  33. {
  34. $this->assertEquals(
  35. 'file.php:1',
  36. $this->wizard->lookup('file.php', 1)
  37. );
  38. }
  39. }