Completed
Push — master ( e3c734...8f98ed )
by Daniel
03:08 queued 16s
created

testPageLengthFieldOverridesDefault()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
class RegistryPageTest extends SapphireTest {
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...
Coding Style introduced by
As per PSR2, the opening brace for this class should be on a new line.
Loading history...
3
4
	static $fixture_file = array(
0 ignored issues
show
Coding Style introduced by
We recommend specifying an explicit visibility for the field $fixture_file.
Loading history...
Coding Style introduced by
The visibility should be declared for property $fixture_file.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
5
		'fixtures/RegistryPageTestContact.yml',
6
		'fixtures/RegistryPageTest.yml'
7
	);
8
9
	protected $extraDataObjects = array(
10
		'RegistryPageTestContact',
11
		'RegistryPageTestSubclass'
12
	);
13
14
	public function testPageLengthDefault() {
15
		$page = $this->objFromFixture('RegistryPage', 'contact-registrypage');
16
		$this->assertEquals(RegistryPage::$page_length_default, $page->getPageLength());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<RegistryPageTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
	}
18
19
	public function testPageLengthFieldOverridesDefault() {
20
		$page = $this->objFromFixture('RegistryPage', 'contact-registrypage-with-length');
21
		$this->assertEquals(20, $page->getPageLength());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<RegistryPageTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
	}
23
24
	public function testDataClass() {
25
		$page = $this->objFromFixture('RegistryPage', 'contact-registrypage');
26
		$this->assertEquals('RegistryPageTestContact', $page->getDataClass());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<RegistryPageTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
27
	}
28
29
	public function testDataSingleton() {
30
		$page = $this->objFromFixture('RegistryPage', 'contact-registrypage');
31
		$this->assertInstanceOf('RegistryPageTestContact', $page->getDataSingleton());
0 ignored issues
show
Bug introduced by
The method getDataSingleton() does not exist on DataObject. Did you maybe mean singleton()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
Bug introduced by
The method assertInstanceOf() does not seem to exist on object<RegistryPageTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
32
	}
33
34
}
0 ignored issues
show
Coding Style introduced by
According to PSR2, the closing brace of classes should be placed on the next line directly after the body.

Below you find some examples:

// Incorrect placement according to PSR2
class MyClass
{
    public function foo()
    {

    }
    // This blank line is not allowed.

}

// Correct
class MyClass
{
    public function foo()
    {

    } // No blank lines after this line.
}
Loading history...
35
36