Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Jobs] moves RestClientFactory.php and JobsPublisherFactory.php into …
…Factoty directory. Adds unittest.
- Loading branch information
Showing
6 changed files
with
85 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
tools: | ||
external_code_coverage: | ||
timeout: 600 | ||
runs: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
module/Jobs/test/JobsTest/Factory/Service/JobsPublisherFactoryTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* YAWIK | ||
* | ||
* @filesource | ||
* @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de) | ||
* @license MIT | ||
*/ | ||
|
||
namespace Jobs\Factory\Service; | ||
|
||
use Test\Bootstrap; | ||
|
||
class JobsPublisherFactoryTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var JobsPublisherFactory | ||
*/ | ||
private $testedObj; | ||
|
||
public function setUp() | ||
{ | ||
$this->testedObj = new JobsPublisherFactory(); | ||
} | ||
|
||
public function testCreateService() | ||
{ | ||
$sm = clone Bootstrap::getServiceManager(); | ||
$sm->setAllowOverride(true); | ||
|
||
|
||
$config=$sm->get('Config'); | ||
$config['multiposting']=array("target"=> array("restServer"=> array("uri"=>"http://test.de", | ||
'PHP_AUTH_USER'=>'user', | ||
'PHP_AUTH_PW' => 'secret'))); | ||
$sm->setService('Config',$config); | ||
|
||
$result = $this->testedObj->createService($sm); | ||
$this->assertInstanceOf('Core\Service\RestClient', $result); | ||
} | ||
} |