Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
tests: add test for removing attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed Mar 20, 2015
1 parent 33c3838 commit e40e25a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Nella/Forms/DateTime/DateTimeInputTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ class DateTimeInputTest extends \Tester\TestCase
Assert::equal('readonly', $control->getControlPart(DateTimeInput::NAME_TIME)->readonly);
}

public function testRemovingAttribute()
{
$control = $this->createControl();

$control->setAttribute('readonly', 'readonly');

Assert::equal('readonly', $control->getControlPart(DateTimeInput::NAME_DATE)->readonly);
Assert::equal('readonly', $control->getControlPart(DateTimeInput::NAME_TIME)->readonly);

$control->setAttribute('readonly', NULL);

Assert::false(isset($control->getControlPart(DateTimeInput::NAME_DATE)->readonly));
Assert::false(isset($control->getControlPart(DateTimeInput::NAME_TIME)->readonly));
}

public function testDateAttribute()
{
$control = $this->createControl();
Expand Down

0 comments on commit e40e25a

Please sign in to comment.