Passed
Push — master ( 92adf4...1a3c92 )
by Sérgio
12:26
created

LastTest::shouldThrowEmptyListException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Prelude\Tests;
4
5
use function Prelude\last;
6
7 View Code Duplication
class LastTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * @test
11
     */
12
    public function test()
13
    {
14
        $this->assertEquals(3, last([1, 2, 3]));
15
        $this->assertEquals(3, last(['a' => 1, 'b' => 2, 'c' => 3]));
16
    }
17
18
    /**
19
     * @test
20
     * @expectedException \Prelude\Exception\EmptyListException
21
     */
22
    public function shouldThrowEmptyListException()
23
    {
24
        last([]);
25
    }
26
}
27