File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
src/PE/Helpers/NodeVariables
tests/PE/Tests/Helpers/NodeVariables Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PE \Helpers \NodeVariables ;
4+
5+ use PE \Nodes \EncoderNodeVariable ;
6+ use PE \Variables \Types \ObjectGetter ;
7+ use PE \Variables \Types \ObjectSetter ;
8+
9+ class EncoderNodeVariableBool extends EncoderNodeVariable {
10+
11+ function __construct ($ id , $ method ) {
12+ parent ::__construct ($ id , false );
13+
14+ $ this ->setType (EncoderNodeVariable::TYPE_BOOL );
15+
16+ $ this ->objectSetter (new ObjectSetter ($ method ));
17+ $ this ->objectGetter (new ObjectGetter ($ method ));
18+ }
19+ }
20+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PE \Tests \Nodes \Children ;
4+
5+ use PE \Helpers \NodeVariables \EncoderNodeVariableBool ;
6+ use PE \Nodes \EncoderNodeVariable ;
7+ use PE \Tests \Samples ;
8+
9+ class EncoderNodeVariableBoolTest extends Samples
10+ {
11+
12+ protected function setUp ()
13+ {
14+ parent ::setUp ();
15+ $ this ->_peApp = new EncoderNodeVariableBool ('method ' , 'isTest ' );
16+ }
17+
18+ /**
19+ * @return EncoderNodeVariableBool
20+ */
21+ protected function variable ()
22+ {
23+ return $ this ->_peApp ;
24+ }
25+
26+ public function testConstructor ()
27+ {
28+ $ boolVariable = new EncoderNodeVariableBool ('test ' , 'isTest ' );
29+ $ this ->assertNotNull ($ boolVariable );
30+ $ this ->assertTrue ($ boolVariable instanceof EncoderNodeVariableBool);
31+
32+ $ this ->assertEquals (EncoderNodeVariable::TYPE_BOOL , $ boolVariable ->getType ());
33+ $ this ->assertEquals ('isTest ' , $ boolVariable ->getObjectSetter ()->getMethod ());
34+ $ this ->assertEquals ('isTest ' , $ boolVariable ->getObjectGetter ()->getMethod ());
35+ }
36+ }
37+ ?>
You can’t perform that action at this time.
0 commit comments