first commit - working
This commit is contained in:
51
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php
vendored
Normal file
51
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
|
||||
class AggregateException extends \RuntimeException implements PredictionException
|
||||
{
|
||||
private $exceptions = array();
|
||||
private $objectProphecy;
|
||||
|
||||
public function append(PredictionException $exception)
|
||||
{
|
||||
$message = $exception->getMessage();
|
||||
$message = strtr($message, array("\n" => "\n "))."\n";
|
||||
$message = empty($this->exceptions) ? $message : "\n" . $message;
|
||||
|
||||
$this->message = rtrim($this->message.$message);
|
||||
$this->exceptions[] = $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PredictionException[]
|
||||
*/
|
||||
public function getExceptions()
|
||||
{
|
||||
return $this->exceptions;
|
||||
}
|
||||
|
||||
public function setObjectProphecy(ObjectProphecy $objectProphecy)
|
||||
{
|
||||
$this->objectProphecy = $objectProphecy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ObjectProphecy
|
||||
*/
|
||||
public function getObjectProphecy()
|
||||
{
|
||||
return $this->objectProphecy;
|
||||
}
|
||||
}
|
24
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php
vendored
Normal file
24
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Basic failed prediction exception.
|
||||
* Use it for custom prediction failures.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*/
|
||||
class FailedPredictionException extends RuntimeException implements PredictionException
|
||||
{
|
||||
}
|
18
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php
vendored
Normal file
18
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use Prophecy\Exception\Prophecy\MethodProphecyException;
|
||||
|
||||
class NoCallsException extends MethodProphecyException implements PredictionException
|
||||
{
|
||||
}
|
18
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php
vendored
Normal file
18
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use Prophecy\Exception\Exception;
|
||||
|
||||
interface PredictionException extends Exception
|
||||
{
|
||||
}
|
31
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php
vendored
Normal file
31
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
|
||||
class UnexpectedCallsCountException extends UnexpectedCallsException
|
||||
{
|
||||
private $expectedCount;
|
||||
|
||||
public function __construct($message, MethodProphecy $methodProphecy, $count, array $calls)
|
||||
{
|
||||
parent::__construct($message, $methodProphecy, $calls);
|
||||
|
||||
$this->expectedCount = intval($count);
|
||||
}
|
||||
|
||||
public function getExpectedCount()
|
||||
{
|
||||
return $this->expectedCount;
|
||||
}
|
||||
}
|
32
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php
vendored
Normal file
32
vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Prophecy.
|
||||
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
* Marcello Duarte <marcello.duarte@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Prophecy\Exception\Prediction;
|
||||
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Exception\Prophecy\MethodProphecyException;
|
||||
|
||||
class UnexpectedCallsException extends MethodProphecyException implements PredictionException
|
||||
{
|
||||
private $calls = array();
|
||||
|
||||
public function __construct($message, MethodProphecy $methodProphecy, array $calls)
|
||||
{
|
||||
parent::__construct($message, $methodProphecy);
|
||||
|
||||
$this->calls = $calls;
|
||||
}
|
||||
|
||||
public function getCalls()
|
||||
{
|
||||
return $this->calls;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user