Completed
Push — master ( 684184...9a35aa )
by Jeroen De
08:07
created

tests/phpunit/elements/ImageOverlayTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Maps\Tests\Elements;
4
5
use Maps\Elements\ImageOverlay;
6
7
/**
8
 * @covers Maps\Elements\ImageOverlay
9
 *
10
 * @since 3.0
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Jeroen De Dauw < [email protected] >
14
 */
15
class ImageOverlayTest extends RectangleTest {
16
17
	/**
18
	 * @see BaseElementTest::getClass
19
	 *
20
	 * @since 3.0
21
	 *
22
	 * @return string
23
	 */
24
	public function getClass() {
25
		return ImageOverlay::class;
26
	}
27
28
	public function validConstructorProvider() {
29
		$argLists = parent::validConstructorProvider();
30
31
		foreach ( $argLists as &$argList ) {
32
			$argList[] = 'Foo.png';
33
		}
34
35
		return $argLists;
36
	}
37
38
	public function invalidConstructorProvider() {
39
		$argLists = parent::validConstructorProvider();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (validConstructorProvider() instead of invalidConstructorProvider()). Are you sure this is correct? If so, you might want to change this to $this->validConstructorProvider().

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...
40
41
		foreach ( $argLists as &$argList ) {
42
			$argList[] = null;
43
		}
44
45
		return $argLists;
46
	}
47
48
	/**
49
	 * @dataProvider instanceProvider
50
	 * @param ImageOverlay $imageOverlay
51
	 * @param array $arguments
52
	 */
53
	public function testGetImage( ImageOverlay $imageOverlay, array $arguments ) {
54
		$this->assertEquals( $arguments[2], $imageOverlay->getImage() );
55
	}
56
57
}
58
59
60
61