forked from TheAlgorithms/PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProjectEulerTest.php
52 lines (42 loc) · 1.32 KB
/
ProjectEulerTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
use PHPUnit\Framework\TestCase;
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem1.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem2.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem3.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem5.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem6.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem7.php';
require_once __DIR__ . '/../../Maths/ProjectEuler/Problem9.php';
class ProjectEulerTest extends TestCase
{
public function testProblem1(): void
{
$this->assertSame(233168, problem1a());
$this->assertSame(233168, problem1b());
}
public function testProblem2(): void
{
$this->assertSame(4613732, problem2());
}
public function testProblem3(): void
{
$this->assertSame(6857, problem3());
}
public function testProblem5(): void
{
$this->assertSame(232792560, problem5());
}
public function testProblem6(): void
{
$this->assertSame(25164150, problem6());
}
public function testProblem7(): void
{
$this->assertSame(104743, problem7());
}
public function testProblem9(): void
{
$this->assertSame(31875000, problem9());
}
}