CodeHasherTest.php 827 B

1234567891011121314151617181920212223242526272829303132
  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\Tokenizer;
  12. use PhpCsFixer\Tests\TestCase;
  13. use PhpCsFixer\Tokenizer\CodeHasher;
  14. /**
  15. * @author SpacePossum
  16. *
  17. * @internal
  18. *
  19. * @covers \PhpCsFixer\Tokenizer\CodeHasher
  20. */
  21. final class CodeHasherTest extends TestCase
  22. {
  23. public function testCodeHasher()
  24. {
  25. $this->assertSame('322920910', CodeHasher::calculateCodeHash('<?php echo 1;'));
  26. $this->assertSame('322920910', CodeHasher::calculateCodeHash('<?php echo 1;')); // calling twice, hashes should always be the same when the input doesn't change.
  27. }
  28. }