Skip to content

Instantly share code, notes, and snippets.

@flesheater
Last active July 15, 2019 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flesheater/a380e54ccdcba45dd09bc59f840efb08 to your computer and use it in GitHub Desktop.
Save flesheater/a380e54ccdcba45dd09bc59f840efb08 to your computer and use it in GitHub Desktop.
DrupalUnitTest
<?php
#tests/src/Unit/FibonacciServiceTest.php
namespace Drupal\Tests\drupalup_fibo\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\drupalup_fibo\FibonacciService;
/**
* Our unit test for the fibonacci service.
*/
class FibonacciServiceTest extends UnitTestCase {
/**
*
*/
public function testFifthFibonacciNumber() {
$fibonacciService = new FibonacciService();
$fiboSequence = $fibonacciService->calcSomeFibos(6);
$this->assertEquals(
$fiboSequence[4],
3
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment