Skip to content

Commit

Permalink
Added test for camelCase settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonShevchuk committed Aug 9, 2013
1 parent 840a09e commit a988ae6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Yandex/Tests/Common/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ public function testSetSettings()
$this->assertEquals($this->fixture->bar, 42);
}

/**
* test CamelCase Settings
*/
public function testCamelCaseSettings()
{
$this->fixture->setSettings(
array(
'foo_bar' => 42
)
);

$this->assertEquals($this->fixture->fooBar, 42);
}

/**
* @covers Yandex\Common\AbstractPackage::checkSettings
* @expectedException \Yandex\Common\Exception\InvalidSettingsException
Expand Down
25 changes: 25 additions & 0 deletions tests/Yandex/Tests/Fixtures/Fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* @property integer $bar
* @property integer $foo
* @property integer $fooBar
*
* @author Anton Shevchuk
* @created 07.08.13 11:48
Expand All @@ -24,6 +25,8 @@ class Fixtures extends AbstractPackage

protected $foo;

protected $fooBar;

protected $readOnly = "OK";

protected $writeOnly = "OK";
Expand Down Expand Up @@ -72,6 +75,28 @@ public function getFoo()
return $this->foo + $this->foo;
}

/**
* setFooBar
*
* @param $value
* @return self
*/
public function setFooBar($value)
{
$this->fooBar = $value;
return $this;
}

/**
* getFooBar
*
* @return mixed
*/
public function getFooBar()
{
return $this->fooBar;
}

/**
* getReadOnly
*
Expand Down

0 comments on commit a988ae6

Please sign in to comment.