Empty Email plugin and test committed.
This commit is contained in:
parent
0c1c3d60ef
commit
f76a2a75cc
46
PHPCI/Plugin/Email.php
Normal file
46
PHPCI/Plugin/Email.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2013, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCI\Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* Email Plugin - Provides simple email capability to PHPCI.
|
||||
* @author Steve Brazier <meadsteve@gmail.com>
|
||||
* @package PHPCI
|
||||
* @subpackage Plugins
|
||||
*/
|
||||
class Email implements \PHPCI\Plugin
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \PHPCI\Builder
|
||||
*/
|
||||
protected $phpci;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $options;
|
||||
|
||||
public function __construct(\PHPCI\Builder $phpci, array $options = array())
|
||||
{
|
||||
$this->phpci = $phpci;
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to MySQL and runs a specified set of queries.
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
64
Tests/PHPCI/Plugin/Email.php
Normal file
64
Tests/PHPCI/Plugin/Email.php
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2013, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCI\Plugin\Tests;
|
||||
use PHPCI\Plugin\Email as EmailPlugin;
|
||||
|
||||
define('PHPCI_BIN_DIR', "FAKEPHPCIBIN");
|
||||
|
||||
/**
|
||||
* Unit test for the PHPUnit plugin.
|
||||
* @author meadsteve
|
||||
*/
|
||||
class EmailTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var EmailPlugin $testedPhpUnit
|
||||
*/
|
||||
protected $testedEmailPlugin;
|
||||
|
||||
/**
|
||||
* @var \PHPUnit_Framework_MockObject_MockObject $mockCiBuilder
|
||||
*/
|
||||
protected $mockCiBuilder;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->mockCiBuilder = $this->getMock(
|
||||
'\PHPCI\Builder',
|
||||
array(),
|
||||
array(),
|
||||
"mockBuilder",
|
||||
false
|
||||
);
|
||||
$this->mockCiBuilder->buildPath = "/";
|
||||
|
||||
$this->loadEmailPluginWithOptions();
|
||||
}
|
||||
|
||||
protected function loadEmailPluginWithOptions($arrOptions = array())
|
||||
{
|
||||
$this->testedEmailPlugin = new EmailPlugin(
|
||||
$this->mockCiBuilder,
|
||||
$arrOptions
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers PHPUnit::execute
|
||||
*/
|
||||
public function testExecute_ReturnsTrueWithoutArgs()
|
||||
{
|
||||
$returnValue = $this->testedEmailPlugin->execute();
|
||||
$expectedReturn = true;
|
||||
|
||||
$this->assertEquals($expectedReturn, $returnValue);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue