Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[tests] Added test conditions

  • Loading branch information...
commit 9471a8b2c6c8c50822fbb984163606d781685751 1 parent 67f18af
@raulfraile raulfraile authored
View
10 tests/ExportFormatsTest.php
@@ -21,20 +21,20 @@ public function setUp() {
}
public function testExportYamlFormat() {
- $data = ladybug_dump_return('yaml', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5]);
+ $data = ladybug_dump_return('yaml', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5], $this->vars[6]);
$this->assertEquals(file_get_contents(__DIR__ . '/files/test.yml'), $data);
}
public function testExportXmlFormat() {
- $data = ladybug_dump_return('xml', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5]);
+ $data = ladybug_dump_return('xml', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5], $this->vars[6]);
$this->assertEquals(file_get_contents(__DIR__ . '/files/test.xml'), $data);
}
public function testExportJsonFormat() {
- $data = ladybug_dump_return('json', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5]);
-
+ $data = ladybug_dump_return('json', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5], $this->vars[6]);
+
$this->assertEquals(file_get_contents(__DIR__ . '/files/test.json'), $data);
}
@@ -42,7 +42,7 @@ public function testExportJsonFormat() {
* @expectedException Ladybug\Exception\InvalidFormatException
*/
public function testUnknownFormatThrowsException() {
- $data = ladybug_dump_return('unknown', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5]);
+ $data = ladybug_dump_return('unknown', $this->vars[0], $this->vars[1], $this->vars[2], $this->vars[3], $this->vars[4], $this->vars[5], $this->vars[6]);
$this->assertEquals(file_get_contents(__DIR__ . '/files/test.unknown'), $data);
}
}
View
2  tests/files/test.json
@@ -1 +1 @@
-{"var1":{"type":"int","value":1},"var2":{"type":"float","value":1},"var3":{"type":"null","value":null},"var4":{"type":"string","value":"hello world","length":11,"encoding":"ASCII"},"var5":{"type":"array","value":[{"type":"int","value":1},{"type":"int","value":2},{"type":"int","value":3}],"length":3},"var6":{"type":"object(DateTime)","value":{"class_info":{"filename":"built-in"},"constants":{"ATOM":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"},"COOKIE":{"type":"string","value":"l, d-M-y H:i:s T","length":16,"encoding":"ASCII"},"ISO8601":{"type":"string","value":"Y-m-d\\TH:i:sO","length":13,"encoding":"ASCII"},"RFC822":{"type":"string","value":"D, d M y H:i:s O","length":16,"encoding":"ASCII"},"RFC850":{"type":"string","value":"l, d-M-y H:i:s T","length":16,"encoding":"ASCII"},"RFC1036":{"type":"string","value":"D, d M y H:i:s O","length":16,"encoding":"ASCII"},"RFC1123":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"RFC2822":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"RFC3339":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"},"RSS":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"W3C":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"}},"public_properties":[],"methods":["+ __construct([$time], [$object])","+ __set_state()","+ __wakeup()","+ add($interval)","+ createFromFormat($format, $time, [$object])","+ diff($object, [$absolute])","+ format($format)","+ getLastErrors()","+ getOffset()","+ getTimestamp()","+ getTimezone()","+ modify($modify)","+ setDate($year, $month, $day)","+ setISODate($year, $week, [$day])","+ setTime($hour, $minute, [$second])","+ setTimestamp($unixtimestamp)","+ setTimezone($timezone)","+ sub($interval)"]}}}
+{"var1":{"type":"int","value":1},"var2":{"type":"float","value":1},"var3":{"type":"null","value":null},"var4":{"type":"string","value":"hello world","length":11,"encoding":"ASCII"},"var5":{"type":"array","value":[{"type":"int","value":1},{"type":"int","value":2},{"type":"int","value":3}],"length":3},"var6":{"type":"object(DateTime)","value":{"class_info":{"filename":"built-in"},"constants":{"ATOM":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"},"COOKIE":{"type":"string","value":"l, d-M-y H:i:s T","length":16,"encoding":"ASCII"},"ISO8601":{"type":"string","value":"Y-m-d\\TH:i:sO","length":13,"encoding":"ASCII"},"RFC822":{"type":"string","value":"D, d M y H:i:s O","length":16,"encoding":"ASCII"},"RFC850":{"type":"string","value":"l, d-M-y H:i:s T","length":16,"encoding":"ASCII"},"RFC1036":{"type":"string","value":"D, d M y H:i:s O","length":16,"encoding":"ASCII"},"RFC1123":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"RFC2822":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"RFC3339":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"},"RSS":{"type":"string","value":"D, d M Y H:i:s O","length":16,"encoding":"ASCII"},"W3C":{"type":"string","value":"Y-m-d\\TH:i:sP","length":13,"encoding":"ASCII"}},"public_properties":[],"methods":["+ __construct([$time], [$object])","+ __set_state()","+ __wakeup()","+ add($interval)","+ createFromFormat($format, $time, [$object])","+ diff($object, [$absolute])","+ format($format)","+ getLastErrors()","+ getOffset()","+ getTimestamp()","+ getTimezone()","+ modify($modify)","+ setDate($year, $month, $day)","+ setISODate($year, $week, [$day])","+ setTime($hour, $minute, [$second])","+ setTimestamp($unixtimestamp)","+ setTimezone($timezone)","+ sub($interval)"]}},"var7":{"type":"bool","value":true}}
View
2  tests/files/test.xml
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
-<response><var1><type><![CDATA[int]]></type><value>1</value></var1><var2><type><![CDATA[float]]></type><value>1</value></var2><var3><type><![CDATA[null]]></type><value/></var3><var4><type><![CDATA[string]]></type><value><![CDATA[hello world]]></value><length>11</length><encoding><![CDATA[ASCII]]></encoding></var4><var5><type><![CDATA[array]]></type><value><type><![CDATA[int]]></type><value>1</value></value><value><type><![CDATA[int]]></type><value>2</value></value><value><type><![CDATA[int]]></type><value>3</value></value><length>3</length></var5><var6><type><![CDATA[object(DateTime)]]></type><value><class_info><filename><![CDATA[built-in]]></filename></class_info><constants><ATOM><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></ATOM><COOKIE><type><![CDATA[string]]></type><value><![CDATA[l, d-M-y H:i:s T]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></COOKIE><ISO8601><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sO]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></ISO8601><RFC822><type><![CDATA[string]]></type><value><![CDATA[D, d M y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC822><RFC850><type><![CDATA[string]]></type><value><![CDATA[l, d-M-y H:i:s T]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC850><RFC1036><type><![CDATA[string]]></type><value><![CDATA[D, d M y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC1036><RFC1123><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC1123><RFC2822><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC2822><RFC3339><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></RFC3339><RSS><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RSS><W3C><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></W3C></constants><public_properties/><methods><![CDATA[+ __construct([$time], [$object])]]></methods><methods><![CDATA[+ __set_state()]]></methods><methods><![CDATA[+ __wakeup()]]></methods><methods><![CDATA[+ add($interval)]]></methods><methods><![CDATA[+ createFromFormat($format, $time, [$object])]]></methods><methods><![CDATA[+ diff($object, [$absolute])]]></methods><methods><![CDATA[+ format($format)]]></methods><methods><![CDATA[+ getLastErrors()]]></methods><methods><![CDATA[+ getOffset()]]></methods><methods><![CDATA[+ getTimestamp()]]></methods><methods><![CDATA[+ getTimezone()]]></methods><methods><![CDATA[+ modify($modify)]]></methods><methods><![CDATA[+ setDate($year, $month, $day)]]></methods><methods><![CDATA[+ setISODate($year, $week, [$day])]]></methods><methods><![CDATA[+ setTime($hour, $minute, [$second])]]></methods><methods><![CDATA[+ setTimestamp($unixtimestamp)]]></methods><methods><![CDATA[+ setTimezone($timezone)]]></methods><methods><![CDATA[+ sub($interval)]]></methods></value></var6></response>
+<response><var1><type><![CDATA[int]]></type><value>1</value></var1><var2><type><![CDATA[float]]></type><value>1</value></var2><var3><type><![CDATA[null]]></type><value/></var3><var4><type><![CDATA[string]]></type><value><![CDATA[hello world]]></value><length>11</length><encoding><![CDATA[ASCII]]></encoding></var4><var5><type><![CDATA[array]]></type><value><type><![CDATA[int]]></type><value>1</value></value><value><type><![CDATA[int]]></type><value>2</value></value><value><type><![CDATA[int]]></type><value>3</value></value><length>3</length></var5><var6><type><![CDATA[object(DateTime)]]></type><value><class_info><filename><![CDATA[built-in]]></filename></class_info><constants><ATOM><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></ATOM><COOKIE><type><![CDATA[string]]></type><value><![CDATA[l, d-M-y H:i:s T]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></COOKIE><ISO8601><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sO]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></ISO8601><RFC822><type><![CDATA[string]]></type><value><![CDATA[D, d M y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC822><RFC850><type><![CDATA[string]]></type><value><![CDATA[l, d-M-y H:i:s T]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC850><RFC1036><type><![CDATA[string]]></type><value><![CDATA[D, d M y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC1036><RFC1123><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC1123><RFC2822><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RFC2822><RFC3339><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></RFC3339><RSS><type><![CDATA[string]]></type><value><![CDATA[D, d M Y H:i:s O]]></value><length>16</length><encoding><![CDATA[ASCII]]></encoding></RSS><W3C><type><![CDATA[string]]></type><value><![CDATA[Y-m-d\TH:i:sP]]></value><length>13</length><encoding><![CDATA[ASCII]]></encoding></W3C></constants><public_properties/><methods><![CDATA[+ __construct([$time], [$object])]]></methods><methods><![CDATA[+ __set_state()]]></methods><methods><![CDATA[+ __wakeup()]]></methods><methods><![CDATA[+ add($interval)]]></methods><methods><![CDATA[+ createFromFormat($format, $time, [$object])]]></methods><methods><![CDATA[+ diff($object, [$absolute])]]></methods><methods><![CDATA[+ format($format)]]></methods><methods><![CDATA[+ getLastErrors()]]></methods><methods><![CDATA[+ getOffset()]]></methods><methods><![CDATA[+ getTimestamp()]]></methods><methods><![CDATA[+ getTimezone()]]></methods><methods><![CDATA[+ modify($modify)]]></methods><methods><![CDATA[+ setDate($year, $month, $day)]]></methods><methods><![CDATA[+ setISODate($year, $week, [$day])]]></methods><methods><![CDATA[+ setTime($hour, $minute, [$second])]]></methods><methods><![CDATA[+ setTimestamp($unixtimestamp)]]></methods><methods><![CDATA[+ setTimezone($timezone)]]></methods><methods><![CDATA[+ sub($interval)]]></methods></value></var6><var7><type><![CDATA[bool]]></type><value>1</value></var7></response>
View
3  tests/files/test.yml
@@ -19,3 +19,6 @@ var5:
var6:
type: object(DateTime)
value: { class_info: { filename: built-in }, constants: { ATOM: { type: string, value: 'Y-m-d\TH:i:sP', length: 13, encoding: ASCII }, COOKIE: { type: string, value: 'l, d-M-y H:i:s T', length: 16, encoding: ASCII }, ISO8601: { type: string, value: 'Y-m-d\TH:i:sO', length: 13, encoding: ASCII }, RFC822: { type: string, value: 'D, d M y H:i:s O', length: 16, encoding: ASCII }, RFC850: { type: string, value: 'l, d-M-y H:i:s T', length: 16, encoding: ASCII }, RFC1036: { type: string, value: 'D, d M y H:i:s O', length: 16, encoding: ASCII }, RFC1123: { type: string, value: 'D, d M Y H:i:s O', length: 16, encoding: ASCII }, RFC2822: { type: string, value: 'D, d M Y H:i:s O', length: 16, encoding: ASCII }, RFC3339: { type: string, value: 'Y-m-d\TH:i:sP', length: 13, encoding: ASCII }, RSS: { type: string, value: 'D, d M Y H:i:s O', length: 16, encoding: ASCII }, W3C: { type: string, value: 'Y-m-d\TH:i:sP', length: 13, encoding: ASCII } }, public_properties: { }, methods: ['+ __construct([$time], [$object])', '+ __set_state()', '+ __wakeup()', '+ add($interval)', '+ createFromFormat($format, $time, [$object])', '+ diff($object, [$absolute])', '+ format($format)', '+ getLastErrors()', '+ getOffset()', '+ getTimestamp()', '+ getTimezone()', '+ modify($modify)', '+ setDate($year, $month, $day)', '+ setISODate($year, $week, [$day])', '+ setTime($hour, $minute, [$second])', '+ setTimestamp($unixtimestamp)', '+ setTimezone($timezone)', '+ sub($interval)'] }
+var7:
+ type: bool
+ value: true
Please sign in to comment.
Something went wrong with that request. Please try again.