SebastianBergmannShortDifferTest.php 911 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of PHP CS Fixer.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. * Dariusz Rumiński <dariusz.ruminski@gmail.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. namespace PhpCsFixer\Tests\Differ;
  12. use PhpCsFixer\Differ\SebastianBergmannShortDiffer;
  13. /**
  14. * @author Andreas Möller <am@localheinz.com>
  15. *
  16. * @internal
  17. *
  18. * @covers \PhpCsFixer\Differ\SebastianBergmannShortDiffer
  19. */
  20. final class SebastianBergmannShortDifferTest extends AbstractDifferTestCase
  21. {
  22. public function testDiffReturnsDiff()
  23. {
  24. $diff = <<<'TXT'
  25. --- Original
  26. +++ New
  27. - function __construct($foo, $bar) {
  28. + public function __construct($foo, $bar)
  29. + {
  30. TXT;
  31. $differ = new SebastianBergmannShortDiffer();
  32. $this->assertSame($diff, $differ->diff($this->oldCode(), $this->newCode()));
  33. }
  34. }