Restructuring

This commit is contained in:
2024-07-01 13:49:44 +00:00
parent f11b705ef0
commit 8d60e1b905
194 changed files with 1296 additions and 112 deletions

25
tests/PrimeTest.php Normal file
View File

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace App\Tests;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use CodingTests\Prime;
#[CoversClass(Prime::class)]
final class PrimeTest extends \PHPUnit\Framework\TestCase
{
public function testisPrime(): void
{
$primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97];
for($test=-100;$test<=100;$test++)
{
$ret = Prime::isPrime($test);
$this->assertEquals(in_array($test, $primes), $ret, "Testing $test");
}
}
}