Fix tests according to branch 'api-refactor'

This commit is contained in:
xdrm-brackets 2017-11-11 13:09:30 +01:00
parent 6b9bd03d9e
commit 34ffdae4fe
2 changed files with 25 additions and 25 deletions

View File

@ -67,9 +67,9 @@
allow('file_exists')->toBeCalled()->andReturn(true);
// normally the 'module' module is always here for testing purposes
$err = ModuleFactory::getModule('module');
$err = ModuleFactory::getModule('documentationDefault');
expect($err)->not->toBeAnInstanceOf('\\error\\core\\Error');
expect($err)->not->toBeAnInstanceOf("\\error\\core\\Error");
});

View File

@ -274,7 +274,7 @@
it('fail when unknown method', function(){
allow('json_decode')->toBeCalled()->andReturn([
'mo-du_leA' => [ 'POST::me-th_odA' => [] ],
'mo-du_leA' => [ 'me-th_odA' => [] ],
'moduleB' => []
]);
@ -299,7 +299,7 @@
allow(Request::class)->toReceive('buildOptions')->andReturn(true);
allow('json_decode')->toBeCalled()->andReturn([
'mo-du_leA' => [ 'POST::me-th_odA' => [] ],
'mo-du_leA' => [ 'me-th_odA' => [] ],
'moduleB' => []
]);
@ -320,7 +320,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => []
'methodA' => []
]
]);
@ -338,7 +338,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => [
'methodA' => [
'permissions' => 23.2
]
]
@ -358,7 +358,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => [
'methodA' => [
'permissions' => []
]
]
@ -381,7 +381,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => [
'methodA' => [
'permissions' => ['a']
]
]
@ -400,7 +400,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => [
'methodA' => [
'permissions' => ['a']
]
]
@ -420,7 +420,7 @@
allow('json_decode')->toBeCalled()->andReturn([
'moduleA' => [
'POST::methodA' => [
'methodA' => [
'permissions' => ['a']
]
]
@ -466,7 +466,7 @@
$this->json = [
'moduleA' => [
'POST::methodA' => []
'methodA' => []
]
];
@ -499,7 +499,7 @@
it('fail if \'parameters\' has no <string> name', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
1 => []
];
allow('json_decode')->toBeCalled()->andReturn($this->json);
@ -511,7 +511,7 @@
it('fail if \'parameters\' has no <array> specification', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => 1
];
allow('json_decode')->toBeCalled()->andReturn($this->json);
@ -523,7 +523,7 @@
it('fail if one \'parameters\' have no \'type\' clause', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => false
]
@ -537,7 +537,7 @@
it('fail if one \'parameters\' have incorrect \'type\' clause', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => false,
'type' => 12
@ -556,7 +556,7 @@
it('pass if missing optional parameter -> set to null by default', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => true,
'type' => 'text'
@ -576,7 +576,7 @@
it('fail if optional param wrong type ', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => true,
'type' => 'id'
@ -592,7 +592,7 @@
it('pass if optional param matching type ', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => true,
'type' => 'id'
@ -608,7 +608,7 @@
it('fail if required param missing ', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => false,
'type' => 'id'
@ -623,7 +623,7 @@
it('fail if required param wrong type ', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => false,
'type' => 'id'
@ -639,7 +639,7 @@
it('pass if required param matching type ', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => false,
'type' => 'id'
@ -659,7 +659,7 @@
it('fail if FILE param required + file does not exist', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'type' => 'FILE'
]
@ -674,7 +674,7 @@
it('pass if FILE param required + file exists -> create ref', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'type' => 'FILE'
]
@ -694,7 +694,7 @@
it('pass if FILE optional param missing -> null', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => true,
'type' => 'FILE'
@ -715,7 +715,7 @@
it('pass if FILE optional param + file exists -> create ref', function(){
$this->json['moduleA']['POST::methodA']['parameters'] = [
$this->json['moduleA']['methodA']['parameters'] = [
'paramName' => [
'optional' => true,
'type' => 'FILE'