Completed
Push — master ( 5b4fcf...5a8d3e )
by Martijn
11s
created

Base_PHPUnit5::expectException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
class Base_PHPUnit5 extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
	/**
6
	 * @param string $exception
7
	 * @param string $message
8
	 * @return void
9
	 */
10
	public function expectException($exception, $message = '')
11
	{
12
		parent::setExpectedException($exception, $message);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (setExpectedException() instead of expectException()). Are you sure this is correct? If so, you might want to change this to $this->setExpectedException().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
13
	}
14
}
15