Skip to content

Commit 6309d9e

Browse files
committed
add test for serialization method alias
1 parent e4e01b3 commit 6309d9e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/SerializationTest.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,21 @@ public function test_methods_takes_a_string()
6464
$this->assert_equals('ANCIENT ART OF MAIN TANKING', $a['upper_name']);
6565
}
6666

67-
// methods added last should we shuld have value of the method in our json
68-
// rather than the regular attribute value
67+
// methods should take precedence over attributes
6968
public function test_methods_method_same_as_attribute()
7069
{
7170
$a = $this->_a(array('methods' => 'name'));
7271
$this->assert_equals('ancient art of main tanking', $a['name']);
7372
}
7473

74+
public function test_methods_method_alias()
75+
{
76+
$a = $this->_a(array('methods' => array('name' => 'alias_name')));
77+
$this->assert_equals('ancient art of main tanking', $a['alias_name']);
78+
$a = $this->_a(array('methods' => array('upper_name' => 'name')));
79+
$this->assert_equals('ANCIENT ART OF MAIN TANKING', $a['name']);
80+
}
81+
7582
public function test_include()
7683
{
7784
$a = $this->_a(array('include' => array('author')));

0 commit comments

Comments
 (0)