This repository was archived by the owner on Nov 24, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathStepTest.php
More file actions
37 lines (32 loc) · 1.49 KB
/
StepTest.php
File metadata and controls
37 lines (32 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once 'PHPUnit/Extensions/Story/TestCase.php';
require_once 'PHPUnit/Extensions/Story/Then.php';
class StepTest extends PHPUnit_Framework_TestCase {
protected function setUp() {
parent::setUp();
}
public function testGetArgumentsAsStringWithStringAsArgumentDisplayElementAsString() {
$Step = new PHPUnit_Extensions_Story_Then(array('action', 'keep behavior with string'));
$expected = "keep behavior with string";
$this->assertEquals($expected, $Step->getArguments(true));
}
public function testGetArgumentsAsStringWithSingleArrayAsArgumentDisplayElementAsString() {
$Step = new PHPUnit_Extensions_Story_Then(array('action', array('single element')));
$expected = "array (\n 0 => 'single element',\n)";
$this->assertEquals($expected, $Step->getArguments(true));
}
public function testGetArgumentsAsStringWithObjectAsArgumentDisplayElementAsString() {
$Step = new PHPUnit_Extensions_Story_Then(array('action', new PHPUnit_Extensions_Story_Then(array('action', array('single element')))));
$expected = "PHPUnit_Extensions_Story_Then::__set_state(array("
. "\n 'action' => 'action',"
. "\n 'arguments' => "
. "\n array ("
. "\n 0 => "
. "\n array ("
. "\n 0 => 'single element',"
. "\n ),"
. "\n ),"
. "\n))";
$this->assertEquals($expected, $Step->getArguments(true));
}
}