Орла
Области
Компаний
Пользователи
Галерея
Фиксированные новости
Орла
Отзывы о фирмах
Тарифы
Пользователи
Области
Банкоматы
Торговые точки
Доска объявлений
Курсы валют
Скидки
организации Орла
организации области
товары
сайты
сайты Орел
Данные
Разделы
Поиск
Поиск запросы
Статистика
Показы каталога организаций
Статистика клиенты
Пользователи
Сайты
Управление сайтом
Анкета
Аптеки
Афиша
Афиша новая
Баннеры
Бизнес >
Викторина
Голосование
Гость на сайте
Истории
Календарь событий
Каталоги >
Конкурс красоты
Конкурс аудио
Консультации
Меню
Новое на сайте
Новости >
Организации >
Программа ТВ
Публикации
Разделы сайта
Рассылка
Рестораны
Секрет фирмы >
Сервисы >
Ссылки
Тесты
Файловый менеджер
Форум
Фотогалерея
Обратная связь
Недвижимость
Новый год
Тексты
Пользователи
Юридический рейтинг
Отзывы на товары
Бан пользователей
Жалобы
Новые тесты
Коронавирус
Файловый менеджер
Имя файла
Constraint.php
Содержимое
<?php /* * This file is part of PHPUnit. * * (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. */ use SebastianBergmann\Exporter\Exporter; /** * Abstract base class for constraints which can be applied to any value. * * @since Interface available since Release 3.0.0 */ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framework_SelfDescribing { protected $exporter; public function __construct() { $this->exporter = new Exporter; } /** * Evaluates the constraint for parameter $other * * If $returnResult is set to false (the default), an exception is thrown * in case of a failure. null is returned otherwise. * * If $returnResult is true, the result of the evaluation is returned as * a boolean value instead: true in case of success, false in case of a * failure. * * @param mixed $other Value or object to evaluate. * @param string $description Additional information about the test * @param bool $returnResult Whether to return a result or throw an exception * * @return mixed * * @throws PHPUnit_Framework_ExpectationFailedException */ public function evaluate($other, $description = '', $returnResult = false) { $success = false; if ($this->matches($other)) { $success = true; } if ($returnResult) { return $success; } if (!$success) { $this->fail($other, $description); } } /** * 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 false; } /** * Counts the number of constraint elements. * * @return int * * @since Method available since Release 3.4.0 */ public function count() { return 1; } /** * Throws an exception for the given compared value and test description * * @param mixed $other Evaluated value or object. * @param string $description Additional information about the test * @param SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure * * @throws PHPUnit_Framework_ExpectationFailedException */ protected function fail($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null) { $failureDescription = sprintf( 'Failed asserting that %s.', $this->failureDescription($other) ); $additionalFailureDescription = $this->additionalFailureDescription($other); if ($additionalFailureDescription) { $failureDescription .= "\n" . $additionalFailureDescription; } if (!empty($description)) { $failureDescription = $description . "\n" . $failureDescription; } throw new PHPUnit_Framework_ExpectationFailedException( $failureDescription, $comparisonFailure ); } /** * Return additional failure description where needed * * The function can be overridden to provide additional failure * information like a diff * * @param mixed $other Evaluated value or object. * * @return string */ protected function additionalFailureDescription($other) { return ''; } /** * 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. * * To provide additional failure information additionalFailureDescription * can be used. * * @param mixed $other Evaluated value or object. * * @return string */ protected function failureDescription($other) { return $this->exporter->export($other) . ' ' . $this->toString(); } }
/vendor/phpunit/phpunit/src/Framework/
Имя
Дата
Размер
..
2017-06-21
Assert
2017-06-21
Constraint
2017-06-21
Error
2017-06-21
TestSuite
2017-06-21
Assert.php
2017-06-21
96 кб.
Assert.php~
2025-01-10
96 кб.
AssertionFailedError.php
2017-06-21
635 байт
AssertionFailedError.php~
2025-01-10
635 байт
BaseTestListener.php
2017-06-21
1 кб.
BaseTestListener.php~
2025-01-10
1 кб.
CodeCoverageException.php
2017-06-21
369 байт
CodeCoverageException.php~
2025-01-10
369 байт
Constraint.php
2017-06-21
4 кб.
Constraint.php~
2025-01-10
4 кб.
Error.php
2017-06-21
804 байт
Error.php~
2025-01-10
804 байт
Exception.php
2017-06-21
2 кб.
Exception.php~
2025-01-10
2 кб.
ExceptionWrapper.php
2017-06-21
2 кб.
ExceptionWrapper.php~
2025-01-10
2 кб.
ExpectationFailedException.php
2017-06-21
1 кб.
ExpectationFailedException.php~
2025-01-10
1 кб.
IncompleteTest.php
2017-06-21
479 байт
IncompleteTest.php~
2025-01-10
479 байт
IncompleteTestCase.php
2017-06-21
2 кб.
IncompleteTestCase.php~
2025-01-10
2 кб.
IncompleteTestError.php
2017-06-21
531 байт
IncompleteTestError.php~
2025-01-10
531 байт
InvalidCoversTargetError.php
2017-06-21
578 байт
InvalidCoversTargetError.php~
2025-01-10
578 байт
InvalidCoversTargetException.php
2017-06-21
388 байт
InvalidCoversTargetException.php~
2025-01-10
388 байт
OutputError.php
2017-06-21
487 байт
OutputError.php~
2025-01-10
487 байт
RiskyTest.php
2017-06-21
425 байт
RiskyTest.php~
2025-01-10
425 байт
RiskyTestError.php
2017-06-21
515 байт
RiskyTestError.php~
2025-01-10
515 байт
SelfDescribing.php
2017-06-21
534 байт
SelfDescribing.php~
2025-01-10
534 байт
SkippedTest.php
2017-06-21
398 байт
SkippedTest.php~
2025-01-10
398 байт
SkippedTestCase.php
2017-06-21
1 кб.
SkippedTestCase.php~
2025-01-10
1 кб.
SkippedTestError.php
2017-06-21
521 байт
SkippedTestError.php~
2025-01-10
521 байт
SkippedTestSuiteError.php
2017-06-21
532 байт
SkippedTestSuiteError.php~
2025-01-10
532 байт
SyntheticError.php
2017-06-21
2 кб.
SyntheticError.php~
2025-01-10
2 кб.
Test.php
2017-06-21
655 байт
Test.php~
2025-01-10
655 байт
TestCase.php
2017-06-21
62 кб.
TestCase.php~
2025-01-10
62 кб.
TestFailure.php
2017-06-21
4 кб.
TestFailure.php~
2025-01-10
4 кб.
TestListener.php
2017-06-21
3 кб.
TestListener.php~
2025-01-10
3 кб.
TestResult.php
2017-06-21
27 кб.
TestResult.php~
2025-01-10
27 кб.
TestSuite.php
2017-06-21
28 кб.
TestSuite.php~
2025-01-10
28 кб.
UnintentionallyCoveredCodeError.php
2017-06-21
519 байт
UnintentionallyCoveredCodeError.php~
2025-01-10
519 байт
Warning.php
2017-06-21
1 кб.
Warning.php~
2025-01-10
1 кб.
/vendor/phpunit/phpunit/src/Framework
Загрузить файлы
Файл 1
Файл 2
Файл 3