php-censor/tests/PHPCensor/Helper/BuildInterpolatorTest.php

49 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2016-07-19 20:28:11 +02:00
namespace Tests\PHPCensor\Plugin\Helper;
2016-07-19 20:28:11 +02:00
use PHPCensor\Helper\BuildInterpolator;
class BuildInterpolatorTest extends \PHPUnit_Framework_TestCase
{
/**
* @var BuildInterpolator
*/
protected $testedInterpolator;
protected function setUp()
{
parent::setup();
$this->testedInterpolator = new BuildInterpolator();
}
public function testInterpolate_LeavesStringsUnchangedByDefault()
{
$string = "Hello World";
$expectedOutput = "Hello World";
$actualOutput = $this->testedInterpolator->interpolate($string);
$this->assertEquals($expectedOutput, $actualOutput);
}
public function testInterpolate_LeavesStringsUnchangedWhenBuildIsSet()
{
2016-07-19 20:28:11 +02:00
$build = $this->prophesize('PHPCensor\\Model\\Build')->reveal();
2016-07-22 08:14:10 +02:00
$string = "Hello World";
$expectedOutput = "Hello World";
$this->testedInterpolator->setupInterpolationVars(
$build,
"/buildpath/",
2016-07-22 08:14:10 +02:00
"php-censor.local"
);
$actualOutput = $this->testedInterpolator->interpolate($string);
$this->assertEquals($expectedOutput, $actualOutput);
}
}