Skip to content

Commit

Permalink
Adds test for getDataUsingMethod using digits
Browse files Browse the repository at this point in the history
  • Loading branch information
fooman committed May 17, 2016
1 parent bac009a commit d2d1d19
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/internal/Magento/Framework/Test/Unit/ObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ public function testSetGetDataUsingMethod()
$mock->getDataUsingMethod('test_data');
}

/**
* Test documenting current behaviour of getDataUsingMethod
* _underscore assumes an underscore before any digit
*/
public function testGetDataUsingMethodWithoutUnderscore()
{
$this->_object->setData('key_1', 'value1');
$this->assertTrue($this->_object->hasData('key_1'));
$this->assertEquals('value1', $this->_object->getDataUsingMethod('key_1'));

$this->_object->setData('key2', 'value2');
$this->assertEquals('value2', $this->_object->getData('key2'));
$this->assertEquals(null, $this->_object->getKey2());
$this->assertEquals(null, $this->_object->getDataUsingMethod('key2'));
}

/**
* Tests \Magento\Framework\DataObject->hasData()
*/
Expand Down

0 comments on commit d2d1d19

Please sign in to comment.