forked from DataValues/Common
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonolingualTextValueTest.php
More file actions
73 lines (60 loc) · 1.69 KB
/
MonolingualTextValueTest.php
File metadata and controls
73 lines (60 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace DataValues\Tests;
use DataValues\MonolingualTextValue;
/**
* @covers DataValues\MonolingualTextValue
*
* @since 0.1
*
* @group DataValue
* @group DataValueExtensions
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class MonolingualTextValueTest extends DataValueTest {
/**
* @see DataValueTest::getClass
*
* @return string
*/
public function getClass() {
return 'DataValues\MonolingualTextValue';
}
public function validConstructorArgumentsProvider() {
$argLists = array();
$argLists[] = array( 'en', 'foo' );
$argLists[] = array( 'en', ' foo bar baz foo bar baz foo bar baz foo bar baz foo bar baz foo bar baz ' );
return $argLists;
}
public function invalidConstructorArgumentsProvider() {
$argLists = array();
$argLists[] = array( 42, null );
$argLists[] = array( array(), null );
$argLists[] = array( false, null );
$argLists[] = array( true, null );
$argLists[] = array( null, null );
$argLists[] = array( 'en', 42 );
$argLists[] = array( 'en', false );
$argLists[] = array( 'en', array() );
$argLists[] = array( 'en', null );
$argLists[] = array( '', 'foo' );
return $argLists;
}
/**
* @dataProvider instanceProvider
* @param MonolingualTextValue $text
* @param array $arguments
*/
public function testGetText( MonolingualTextValue $text, array $arguments ) {
$this->assertEquals( $arguments[1], $text->getText() );
}
/**
* @dataProvider instanceProvider
* @param MonolingualTextValue $text
* @param array $arguments
*/
public function testGetLanguageCode( MonolingualTextValue $text, array $arguments ) {
$this->assertEquals( $arguments[0], $text->getLanguageCode() );
}
}