Skip to content

Commit

Permalink
Merge pull request #41 from grycap/tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
micafer authored Nov 15, 2017
2 parents 118dfe6 + cc6380f commit 9c185e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
IM - Infrastructure Manager web GUI
===================================

* Build Status [![Build Status](http://jenkins.i3m.upv.es/buildStatus/icon?job=grycap/im-web-unit)](http://jenkins.i3m.upv.es:8080/job/grycap/job/im-web-unit/)

IM is a tool that ease the access and the usability of IaaS clouds by automating
the VMI selection, deployment, configuration, software installation, monitoring
and update of Virtual Appliances. It supports APIs from a large number of
Expand Down Expand Up @@ -94,4 +96,4 @@ It also supports environment variables to set the IM service location:

```sh
docker run -p 80:80 -e "im_use_rest=true" -e "im_host=server.domain" -e "im_port=8800" -d grycap/im-web
```
```
11 changes: 10 additions & 1 deletion test/unit/test_radlinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@ public function testLaunch()

$_SESSION = array("user"=>"admin", "password"=>"admin");
$_GET = array("op"=>"launch", "id"=>$rowid, "parameters"=>"1", "wn"=>"2");

$im = $this->getMockBuilder(IMRest::class)
->setMethods(['CreateInfrastructure'])
->getMock();
$im->method('CreateInfrastructure')
->willReturn("infid");

$GLOBALS['mock_im'] = $im;
include('../../radlinfo.php');
$this->assertEquals(array('Location: error.php?msg=Error%3A+Connect+error%3A+Connection+refused+%28111%29'),xdebug_get_headers());
unset($GLOBALS['mock_im']);
$this->assertEquals(array('Location: list.php'),xdebug_get_headers());
}

/**
Expand Down

0 comments on commit 9c185e0

Please sign in to comment.