ComplexityTest.php 830 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of sebastian/complexity.
  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\Complexity;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * @covers \SebastianBergmann\Complexity\Complexity
  14. *
  15. * @small
  16. */
  17. final class ComplexityTest extends TestCase
  18. {
  19. public function testHasName(): void
  20. {
  21. $this->assertSame('Foo::bar', $this->complexity()->name());
  22. }
  23. public function testHasCyclomaticComplexity(): void
  24. {
  25. $this->assertSame(1, $this->complexity()->cyclomaticComplexity());
  26. }
  27. private function complexity(): Complexity
  28. {
  29. return new Complexity('Foo::bar', 1);
  30. }
  31. }