Skip to content

Commit

Permalink
response/timeout schema rule added
Browse files Browse the repository at this point in the history
  • Loading branch information
nohponex committed Feb 20, 2016
1 parent 19419fd commit 8531754
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/TestParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public function getFilename()
}

/**
* Parse test informations from a json file
* this method will parse the file and prepare the meta object
* Parse test information from a json file
* this method will parse the file and prepare the object
* use createTest to complete creation of test
* @param String $filename JSON file containing the test
* @todo Set $validatorRequest header's subtype
Expand Down Expand Up @@ -176,6 +176,8 @@ public function __construct($filename)
]),
'headers' => (new ObjectValidator())
->setDefault((object)[]),
'timeout' => (new UnsignedIntegerValidator())
->setDefault(null),
'ruleObjects' => (new ArrayValidator())
->setDefault([]),
'export' => (new ObjectValidator(
Expand All @@ -196,7 +198,8 @@ public function __construct($filename)
->setDefault(0),
'ignore' => (new BooleanValidator())
->setDefault(false),
'description' => new StringValidator(),
'description' => (new StringValidator())
->setDefault(null),
'JSONbody' => (new BooleanValidator())
->setDefault(true),
'incomplete' => (new OneOf([
Expand All @@ -205,7 +208,10 @@ public function __construct($filename)
]))->setDefault(false),
]))->setDefault((object) [
'order' => 0,
'JSONbody' => true
'description' => null,
'JSONbody' => true,
'incomplete' => false,
'ignore' => false
]),
'request' => $validatorRequest,
'response' => $validatorResponse
Expand All @@ -219,14 +225,8 @@ public function __construct($filename)
$contentsObject
);

//Fix meta if not defined TODO remove
$this->meta = (
isset($contentsParsed->meta)
? $contentsParsed->meta
: (object)[

]
);
//Set testparser meta
$this->meta = $contentsParsed->meta;
}

/**
Expand Down

0 comments on commit 8531754

Please sign in to comment.