Included vendor/ to the project

This commit is contained in:
2017-09-13 09:35:32 +07:00
parent e72205ff09
commit 17f1643875
2483 changed files with 179073 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
<?php
/*
* This file is part of DbUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\DbUnit\Constraint;
use PHPUnit\DbUnit\DataSet\IDataSet;
use PHPUnit\DbUnit\InvalidArgumentException;
use PHPUnit\Framework\Constraint\Constraint;
/**
* Asserts whether or not two dbunit datasets are equal.
*/
class DataSetIsEqual extends Constraint
{
/**
* @var IDataSet
*/
protected $value;
/**
* @var string
*/
protected $failure_reason;
/**
* Creates a new constraint.
*
* @param IDataSet $value
*/
public function __construct(IDataSet $value)
{
parent::__construct();
$this->value = $value;
}
/**
* Evaluates the constraint for parameter $other. Returns TRUE if the
* constraint is met, FALSE otherwise.
*
* This method can be overridden to implement the evaluation algorithm.
*
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
{
if (!$other instanceof IDataSet) {
throw new InvalidArgumentException(
'PHPUnit_Extensions_Database_DataSet_IDataSet expected'
);
}
return $this->value->matches($other);
}
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)
{
return $other->__toString() . ' ' . $this->toString();
}
/**
* Returns a string representation of the constraint.
*
* @return string
*/
public function toString()
{
return sprintf(
'is equal to expected %s', $this->value->__toString()
);
}
}

View File

@@ -0,0 +1,90 @@
<?php
/*
* This file is part of DbUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\DbUnit\Constraint;
use PHPUnit\DbUnit\DataSet\ITable;
use PHPUnit\DbUnit\InvalidArgumentException;
use PHPUnit\Framework\Constraint\Constraint;
/**
* Asserts whether or not two dbunit tables are equal.
*/
class TableIsEqual extends Constraint
{
/**
* @var ITable
*/
protected $value;
/**
* @var string
*/
protected $failure_reason;
/**
* Creates a new constraint.
*
* @param ITable $value
*/
public function __construct(ITable $value)
{
parent::__construct();
$this->value = $value;
}
/**
* Evaluates the constraint for parameter $other. Returns TRUE if the
* constraint is met, FALSE otherwise.
*
* This method can be overridden to implement the evaluation algorithm.
*
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
{
if (!$other instanceof ITable) {
throw new InvalidArgumentException(
'PHPUnit_Extensions_Database_DataSet_ITable expected'
);
}
return $this->value->matches($other);
}
/**
* Returns the description of the failure
*
* The beginning of failure messages is "Failed asserting that" in most
* cases. This method should return the second part of that sentence.
*
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)
{
return $other->__toString() . ' ' . $this->toString();
}
/**
* Returns a string representation of the constraint.
*
* @return string
*/
public function toString()
{
return sprintf(
'is equal to expected %s', $this->value->__toString()
);
}
}

View File

@@ -0,0 +1,67 @@
<?php
/*
* This file is part of DbUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\DbUnit\Constraint;
use PHPUnit\Framework\Constraint\Constraint;
/**
* Asserts the row count in a table
*/
class TableRowCount extends Constraint
{
/**
* @var int
*/
protected $value;
/**
* @var string
*/
protected $tableName;
/**
* Creates a new constraint.
*
* @param $tableName
* @param $value
*/
public function __construct($tableName, $value)
{
parent::__construct();
$this->tableName = $tableName;
$this->value = $value;
}
/**
* Evaluates the constraint for parameter $other. Returns TRUE if the
* constraint is met, FALSE otherwise.
*
* This method can be overridden to implement the evaluation algorithm.
*
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
{
return $other == $this->value;
}
/**
* Returns a string representation of the constraint.
*
* @return string
*/
public function toString()
{
return sprintf('is equal to expected row count %d', $this->value);
}
}