TestCase for SplitString transformations.
More...
|
static | $result = array("I am", "a test string", "for split") |
|
◆ setUp()
SplitStringTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 17 of file SplitStringTest.php.
18 {
19 $this->f = new Transformation\Factory();
20 $this->split_string = $this->f->splitString("#");
21 }
◆ tearDown()
SplitStringTest::tearDown |
( |
| ) |
|
|
protected |
Definition at line 23 of file SplitStringTest.php.
24 {
25 $this->f = null;
26 $this->split_string = null;
27 }
◆ testInvoke()
SplitStringTest::testInvoke |
( |
| ) |
|
Definition at line 65 of file SplitStringTest.php.
66 {
67 $split_string = $this->f->splitString("#");
68 $arr = $split_string(self::STRING_TO_SPLIT);
70 }
References $result.
◆ testInvokeFails()
SplitStringTest::testInvokeFails |
( |
| ) |
|
Definition at line 72 of file SplitStringTest.php.
73 {
74 $split_string = $this->f->splitString("#");
75
76 $raised = false;
77 try {
78 $arr = [];
79 $next_arr = $split_string($arr);
80 } catch (InvalidArgumentException $e) {
81 $raised = true;
82 }
83 $this->assertTrue($raised);
84
85 $raised = false;
86 try {
87 $number = 1001;
88 $with = $split_string($number);
89 } catch (InvalidArgumentException $e) {
90 $raised = true;
91 }
92 $this->assertTrue($raised);
93
94 $raised = false;
95 try {
96 $std_class = new stdClass();
97 $with = $split_string($std_class);
98 } catch (InvalidArgumentException $e) {
99 $raised = true;
100 }
101 $this->assertTrue($raised);
102 }
◆ testTransform()
SplitStringTest::testTransform |
( |
| ) |
|
Definition at line 29 of file SplitStringTest.php.
30 {
31 $arr = $this->split_string->transform(self::STRING_TO_SPLIT);
33 }
References $result.
◆ testTransformFails()
SplitStringTest::testTransformFails |
( |
| ) |
|
Definition at line 35 of file SplitStringTest.php.
36 {
37 $raised = false;
38 try {
39 $arr = [];
40 $next_arr = $this->split_string->transform($arr);
41 } catch (InvalidArgumentException $e) {
42 $raised = true;
43 }
44 $this->assertTrue($raised);
45
46 $raised = false;
47 try {
48 $without = 1001;
49 $with = $this->split_string->transform($without);
50 } catch (InvalidArgumentException $e) {
51 $raised = true;
52 }
53 $this->assertTrue($raised);
54
55 $raised = false;
56 try {
57 $std_class = new stdClass();
58 $with = $this->split_string->transform($std_class);
59 } catch (InvalidArgumentException $e) {
60 $raised = true;
61 }
62 $this->assertTrue($raised);
63 }
◆ $result
SplitStringTest::$result = array("I am", "a test string", "for split") |
|
staticprotected |
◆ STRING_TO_SPLIT
const SplitStringTest::STRING_TO_SPLIT = "I am#a test string#for split" |
The documentation for this class was generated from the following file: