1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace SebastianBergmann\CodeUnitReverseLookup;
- use PHPUnit\Framework\TestCase;
- class WizardTest extends TestCase
- {
-
- private $wizard;
- protected function setUp()
- {
- $this->wizard = new Wizard;
- }
- public function testMethodCanBeLookedUp()
- {
- require __DIR__ . '/_fixture/Foo.php';
- $this->assertEquals(
- 'Foo::method',
- $this->wizard->lookup(
- __DIR__ . '/_fixture/Foo.php',
- 6
- )
- );
- return $this->wizard;
- }
-
- public function testMethodCanBeLookedUp2(Wizard $wizard)
- {
- require __DIR__ . '/_fixture/Bar.php';
- $this->assertEquals(
- 'Bar::method',
- $wizard->lookup(
- __DIR__ . '/_fixture/Bar.php',
- 6
- )
- );
- }
- public function testReturnsFilenameAndLineNumberAsStringWhenNotInCodeUnit()
- {
- $this->assertEquals(
- 'file.php:1',
- $this->wizard->lookup('file.php', 1)
- );
- }
- }
|