Code Duplication    Length = 23-26 lines in 2 locations

tests/SearchableTest.php 1 location

@@ 26-48 (lines=23) @@
23
24
25
26
	public function testgetFieldValuesAsArrayFromFixtures() {
27
		$manyTypes = $this->objFromFixture('ManyTypesPage', 'manytypes0001');
28
		$result = $manyTypes->getFieldValuesAsArray();
29
		$this->generateAssertionsFromArray($result);
30
		$expected = array(
31
			'BooleanField' => '1',
32
			'CurrencyField' => '100.25',
33
			'DateField' => '2014-04-15',
34
			'DecimalField' => '0',
35
			'EnumField' => '',
36
			'HTMLTextField' => '',
37
			'HTMLVarcharField' => 'This is some *HTML*varchar field',
38
			'IntField' => '677',
39
			'PercentageField' => '27',
40
			'SS_DatetimeField' => '2014-10-18 08:24:00',
41
			'TextField' => 'This is a text field',
42
			'TimeField' => '17:48:18',
43
			'Title' => 'Many Types Page',
44
			'Content' => 'Many types of fields',
45
		);
46
		$this->assertEquals($expected, $result);
47
48
	}
49
50
51

tests/TranslatableSearchableTest.php 1 location

@@ 34-59 (lines=26) @@
31
32
33
34
	public function testgetFieldValuesAsArrayWithLocale() {
35
		$manyTypes = $this->objFromFixture('ManyTypesPage', 'manytypes0001');
36
		$result = $manyTypes->getFieldValuesAsArray();
37
		$this->generateAssertionsFromArray($result);
38
39
		$expected = array(
40
			'BooleanField' => '1',
41
			'CurrencyField' => '100.25',
42
			'DateField' => '2014-04-15',
43
			'DecimalField' => '0',
44
			'EnumField' => '',
45
			'HTMLTextField' => '',
46
			'HTMLVarcharField' => 'This is some *HTML*varchar field',
47
			'IntField' => '677',
48
			'PercentageField' => '27',
49
			'SS_DatetimeField' => '2014-10-18 08:24:00',
50
			'TextField' => 'This is a text field',
51
			'TimeField' => '17:48:18',
52
			'Title' => 'Many Types Page',
53
			'Content' => 'Many types of fields',
54
		);
55
		$this->assertEquals($expected, $result);
56
57
	}
58
59
60
	/**
61
	 * Test a valid identifier
62
	 */