Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
[TASK] Add unit tests for Behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
romm committed Mar 19, 2017
1 parent 31b5d72 commit 78a88f0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Classes/Configuration/Form/Field/Behaviour/Behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,12 @@ public function getClassName()
{
return $this->className;
}

/**
* @param string $className
*/
public function setClassName($className)
{
$this->className = $className;
}
}
24 changes: 24 additions & 0 deletions Tests/Unit/Configuration/Form/Field/Behaviour/BehaviourTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace Romm\Formz\Tests\Unit\Configuration;

use Romm\Formz\Behaviours\BehaviourInterface;
use Romm\Formz\Configuration\Form\Field\Behaviour\Behaviour;
use Romm\Formz\Tests\Unit\AbstractUnitTest;

class BehaviourTest extends AbstractUnitTest
{
/**
* @test
*/
public function setClassNamesSetsClassName()
{
$behaviour = new Behaviour;

$behaviourInstance = $this->getMockBuilder(BehaviourInterface::class)
->getMockForAbstractClass();
$behaviourClass = get_class($behaviourInstance);

$behaviour->setClassName($behaviourClass);
$this->assertEquals($behaviourClass, $behaviour->getClassName());
}
}
2 changes: 1 addition & 1 deletion Tests/Unit/Configuration/Form/Field/FieldTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Romm\Formz\Tests\Unit\Configuration;
namespace Romm\Formz\Tests\Unit\Configuration\Field;

use Romm\Formz\Configuration\Form\Field\Activation\ActivationInterface;
use Romm\Formz\Configuration\Form\Field\Behaviour\Behaviour;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Romm\Formz\Tests\Unit\Configuration\Validation;
namespace Romm\Formz\Tests\Unit\Configuration\Field\Validation;

use Romm\Formz\Configuration\Form\Field\Validation\Message;
use Romm\Formz\Tests\Unit\AbstractUnitTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Romm\Formz\Tests\Unit\Configuration\Validation;
namespace Romm\Formz\Tests\Unit\Configuration\Field\Validation;

use Romm\Formz\Configuration\Form\Field\Activation\ActivationInterface;
use Romm\Formz\Configuration\Form\Field\Field;
Expand Down

0 comments on commit 78a88f0

Please sign in to comment.