GitHub
Tests: 12 • Commercial: 2 • Pet projects: 4 • Legacy: 4
Total: 22

.NET Framework

Test
2021

Project Request

ASP.NET MVC • C# • SQL Server
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2020

ProjectC

ASP.NET MVC • C# • JSON • jQuery
JSON data processing.
Test
2020

Vehicle Maintenance

ASP.NET MVC • VB.NET • JSON
Idea of the project: if someone wants to order a project development, here you can send an application.
Test
2019

Movie Navigator

ASP.NET MVC • VB.NET
Request information about movie from IMDB.
Test
2018

Customers Exchange

ASP.NET MVC • C# • SQL Server
Automated teller machine emulation.
Test
2016

ATM

ASP.NET MVC • C#
Automated teller machine emulation.

.NET Core

Pet project
2022

Mail Daemon

.NET 9 • Console • JSON
Utility to send mails with customizable settings.

Custom

Code
2024

Buns of code

.NET Framework • C# • JavaScript
Code snippets from my projects, ready to use; tiny tests; code examples.

PHP

Test
2024

Mediabox

PHP 8 • Laravel 11 • Vue.js • Composer • SQLite
Test project for media files management.
Test
2020

Loan Castle

PHP • MariaDB
Jums jāizstrādā kāda lielāk projekta prototips. Izstrādājot prototipu, paturiet prātā, ka projektam attīstoties, šo prototipu varētu vajadzēt pilnveidot.
Test
2020

Content Management

PHP • MySQL • AJAX
Создать простой сайт, где будет страница с формой для авторизации и страница для авторизованного пользователя.
Test
2019

Laravel

PHP • Laravel • Vue.js • Composer • SQLite
Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.
Test
2019

Phone Check

PHP • JavaScript • JSON • Docker
Implement application to detect country by phone number.

Frontend

Test
2021

Forex Wall

npm • React
For this exercise, what we need is a simple live wall for tracking currencies.

Business projects

Commercial
2008

Certification Center

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Dapper • JavaScript • jQuery • Git
Transport registration and certification services in Latvia, Customer Relationship Management.
Commercial
2000

Amerikas Auto

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • SQL Server • ADO.NET • Entity Framework • JavaScript • jQuery • Git
Car service and spare parts for all USA and European car models, Customer Relationship Management.

Pet projects

Pet project
2023

Geolocation Assistant

.NET 8 • ASP.NET Core • C# • Web API • JSON • Git
Website for determining geolocation by IP or geotagged photo.
Pet project
2008

Web Dynamics

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
Software development blog. Articles, books, videos, content management.
Pet project
2000

Blackball

.NET Framework 4.8 • ASP.NET Web Forms • C# • LINQ • Web API • JSON • XML • SQL Server • Dapper • JavaScript • jQuery • SVG • Git
My entertainment portal created from scratch.

Good old times

Legacy
2000

DOS Clock

Turbo Pascal • Assembler
Digital clock.
Legacy
2000

BrainOut

Turbo Pascal • Assembler
Tank battle game.
Legacy
1999

Airport Administrator

Turbo Pascal
Курсовая работа в институте.
Legacy
1998

Atomizer

Turbo Pascal • Assembler
Atomizer, aka «Studio2D». Graphic raster editor. AGI is my own «Atomizer Generated Image» file format.

Laravel

2019 Test

Izveidot aplikāciju, kura ik pēc noteikta intervāla (60 sekundes) veic ierakstu datubāzē izmantojot Laravel freimworka iebūvēto funkcionalitāti.

PHP Laravel Vue.js Composer SQLite
Information
Source code
  app
  Http
  Auth
  css
  js
  js
  lang
  en
  sass
  app
  data
  logs
  Unit
  src
  src
  lib
  docs
  en
  src
  docs
  en
  lib
  src
  Cron
  Cron
  src
  filp
  src
  css
  js
  Util
  src
  ORM
  Spot
  test
  Core
  Text
  Type
  Xml
  Core
  Text
  Type
  Xml
  html
  src
  src
  src
  Auth
  make
  auth
  Bus
  Auth
  Bus
  Http
  Mail
  View
  Auth
  Bus
  Http
  Http
  Json
  Log
  Mail
  html
  text
  Jobs
  View
  src
  src
  Util
  docs
  Pass
  Pass
  Pass
  doc
  src
  Curl
  doc
  f001
  f002
  f003
  f004
  f005
  f006
  f007
  f008
  src
  Date
  Spl
  src
  Lang
  List
  doc
  lib
  Node
  Expr
  Cast
  Name
  Stmt
  test
  code
  expr
  uvs
  stmt
  loop
  expr
  stmt
  Node
  Stmt
  src
  opis
  src
  dist
  lib
  src
  xml
  xml
  src
  Unit
  src
  src
  Tags
  src
  src
  src
  Call
  Node
  Call
  Util
  src
  Node
  Html
  css
  js
  Xml
  HTML
  XML
  src
  src
  src
  src
  src
  Stub
  Hook
  Util
  Log
  PHP
  cli
  1149
  1216
  1265
  1330
  1335
  1337
  1348
  1351
  1374
  1437
  1468
  1471
  1472
  1570
  2085
  2137
  2145
  2158
  2366
  2380
  2382
  2435
  244
  2448
  2724
  2725
  2731
  2811
  2830
  2972
  3093
  3107
  3156
  322
  3364
  3379
  3380
  3396
  433
  445
  498
  503
  581
  74
  765
  797
  873
  Trac
  1021
  523
  578
  684
  783
  fail
  unit
  Util
  PHP
  psr
  src
  log
  Psr
  Log
  Test
  src
  psy
  src
  Sudo
  Util
  test
  Sudo
  Util
  box
  uuid
  src
  Time
  Node
  Time
  src
  src
  diff
  src
  out
  src
  src
  src
  src
  src
  src
  src
  src
  doc
  lib
  Mime
  Pop
  Auth
  Mime
  bug
  unit
  Mime
  Auth
  dkim
  Node
  Node
  psr4
  phpt
  .dot
  b
  a
  A
  B
  C
  copy
  A
  B
  C
  one
  b
  .dot
  a
  dir
  File
  Test
  File
  test
  Test
  Log
  Log
  mime
  Part
  test
  Part
  glob
  Test
  data
  dat
  res
  Util
  Util
  Test
  css
  js
  Test
  Test
  src
  src
  Css
  Rule
  src
  src
  .env
  null
Root / vendor / phpunit / phpunit / src / Framework / TestResult.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. */ namespace PHPUnit\Framework; use AssertionError; use Countable; use Error; use PHPUnit\Framework\MockObject\Exception as MockObjectException; use PHPUnit\Util\Blacklist; use PHPUnit\Util\ErrorHandler; use PHPUnit\Util\Printer; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException as OriginalCoveredCodeNotExecutedException; use SebastianBergmann\CodeCoverage\Exception as OriginalCodeCoverageException; use SebastianBergmann\CodeCoverage\MissingCoversAnnotationException as OriginalMissingCoversAnnotationException; use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Invoker\Invoker; use SebastianBergmann\Invoker\TimeoutException; use SebastianBergmann\ResourceOperations\ResourceOperations; use SebastianBergmann\Timer\Timer; use Throwable; /** * A TestResult collects the results of executing a test case. */ class TestResult implements Countable { /** * @var array */ protected $passed = []; /** * @var TestFailure[] */ protected $errors = []; /** * @var TestFailure[] */ protected $failures = []; /** * @var TestFailure[] */ protected $warnings = []; /** * @var TestFailure[] */ protected $notImplemented = []; /** * @var TestFailure[] */ protected $risky = []; /** * @var TestFailure[] */ protected $skipped = []; /** * @var TestListener[] */ protected $listeners = []; /** * @var int */ protected $runTests = 0; /** * @var float */ protected $time = 0; /** * @var TestSuite */ protected $topTestSuite; /** * Code Coverage information. * * @var CodeCoverage */ protected $codeCoverage; /** * @var bool */ protected $convertErrorsToExceptions = true; /** * @var bool */ protected $stop = false; /** * @var bool */ protected $stopOnError = false; /** * @var bool */ protected $stopOnFailure = false; /** * @var bool */ protected $stopOnWarning = false; /** * @var bool */ protected $beStrictAboutTestsThatDoNotTestAnything = true; /** * @var bool */ protected $beStrictAboutOutputDuringTests = false; /** * @var bool */ protected $beStrictAboutTodoAnnotatedTests = false; /** * @var bool */ protected $beStrictAboutResourceUsageDuringSmallTests = false; /** * @var bool */ protected $enforceTimeLimit = false; /** * @var int */ protected $timeoutForSmallTests = 1; /** * @var int */ protected $timeoutForMediumTests = 10; /** * @var int */ protected $timeoutForLargeTests = 60; /** * @var bool */ protected $stopOnRisky = false; /** * @var bool */ protected $stopOnIncomplete = false; /** * @var bool */ protected $stopOnSkipped = false; /** * @var bool */ protected $lastTestFailed = false; /** * @var int */ private $defaultTimeLimit = 0; /** * @var bool */ private $stopOnDefect = false; /** * @var bool */ private $registerMockObjectsFromTestArgumentsRecursively = false; public static function isAnyCoverageRequired(TestCase $test) { $annotations = $test->getAnnotations(); // If there is a @coversNothing annotation on the test method then code // coverage data does not need to be collected if (isset($annotations['method']['coversNothing'])) { return false; } // If any methods have covers, coverage must me generated if (isset($annotations['method']['covers'])) { return true; } // If there are no explicit covers, and the test class is // marked as covers nothing, all coverage can be skipped if (isset($annotations['class']['coversNothing'])) { return false; } // Otherwise each test method can generate coverage return true; } /** * Registers a TestListener. */ public function addListener(TestListener $listener): void { $this->listeners[] = $listener; } /** * Unregisters a TestListener. */ public function removeListener(TestListener $listener): void { foreach ($this->listeners as $key => $_listener) { if ($listener === $_listener) { unset($this->listeners[$key]); } } } /** * Flushes all flushable TestListeners. */ public function flushListeners(): void { foreach ($this->listeners as $listener) { if ($listener instanceof Printer) { $listener->flush(); } } } /** * Adds an error to the list of errors. */ public function addError(Test $test, Throwable $t, float $time): void { if ($t instanceof RiskyTest) { $this->risky[] = new TestFailure($test, $t); $notifyMethod = 'addRiskyTest'; if ($test instanceof TestCase) { $test->markAsRisky(); } if ($this->stopOnRisky || $this->stopOnDefect) { $this->stop(); } } elseif ($t instanceof IncompleteTest) { $this->notImplemented[] = new TestFailure($test, $t); $notifyMethod = 'addIncompleteTest'; if ($this->stopOnIncomplete) { $this->stop(); } } elseif ($t instanceof SkippedTest) { $this->skipped[] = new TestFailure($test, $t); $notifyMethod = 'addSkippedTest'; if ($this->stopOnSkipped) { $this->stop(); } } else { $this->errors[] = new TestFailure($test, $t); $notifyMethod = 'addError'; if ($this->stopOnError || $this->stopOnFailure) { $this->stop(); } } // @see https://github.com/sebastianbergmann/phpunit/issues/1953 if ($t instanceof Error) { $t = new ExceptionWrapper($t); } foreach ($this->listeners as $listener) { $listener->$notifyMethod($test, $t, $time); } $this->lastTestFailed = true; $this->time += $time; } /** * Adds a warning to the list of warnings. * The passed in exception caused the warning. */ public function addWarning(Test $test, Warning $e, float $time): void { if ($this->stopOnWarning || $this->stopOnDefect) { $this->stop(); } $this->warnings[] = new TestFailure($test, $e); foreach ($this->listeners as $listener) { $listener->addWarning($test, $e, $time); } $this->time += $time; } /** * Adds a failure to the list of failures. * The passed in exception caused the failure. */ public function addFailure(Test $test, AssertionFailedError $e, float $time): void { if ($e instanceof RiskyTest || $e instanceof OutputError) { $this->risky[] = new TestFailure($test, $e); $notifyMethod = 'addRiskyTest'; if ($test instanceof TestCase) { $test->markAsRisky(); } if ($this->stopOnRisky || $this->stopOnDefect) { $this->stop(); } } elseif ($e instanceof IncompleteTest) { $this->notImplemented[] = new TestFailure($test, $e); $notifyMethod = 'addIncompleteTest'; if ($this->stopOnIncomplete) { $this->stop(); } } elseif ($e instanceof SkippedTest) { $this->skipped[] = new TestFailure($test, $e); $notifyMethod = 'addSkippedTest'; if ($this->stopOnSkipped) { $this->stop(); } } else { $this->failures[] = new TestFailure($test, $e); $notifyMethod = 'addFailure'; if ($this->stopOnFailure || $this->stopOnDefect) { $this->stop(); } } foreach ($this->listeners as $listener) { $listener->$notifyMethod($test, $e, $time); } $this->lastTestFailed = true; $this->time += $time; } /** * Informs the result that a test suite will be started. */ public function startTestSuite(TestSuite $suite): void { if ($this->topTestSuite === null) { $this->topTestSuite = $suite; } foreach ($this->listeners as $listener) { $listener->startTestSuite($suite); } } /** * Informs the result that a test suite was completed. */ public function endTestSuite(TestSuite $suite): void { foreach ($this->listeners as $listener) { $listener->endTestSuite($suite); } } /** * Informs the result that a test will be started. */ public function startTest(Test $test): void { $this->lastTestFailed = false; $this->runTests += \count($test); foreach ($this->listeners as $listener) { $listener->startTest($test); } } /** * Informs the result that a test was completed. * * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ public function endTest(Test $test, float $time): void { foreach ($this->listeners as $listener) { $listener->endTest($test, $time); } if (!$this->lastTestFailed && $test instanceof TestCase) { $class = \get_class($test); $key = $class . '::' . $test->getName(); $this->passed[$key] = [ 'result' => $test->getResult(), 'size' => \PHPUnit\Util\Test::getSize( $class, $test->getName(false) ), ]; $this->time += $time; } } /** * Returns true if no risky test occurred. */ public function allHarmless(): bool { return $this->riskyCount() == 0; } /** * Gets the number of risky tests. */ public function riskyCount(): int { return \count($this->risky); } /** * Returns true if no incomplete test occurred. */ public function allCompletelyImplemented(): bool { return $this->notImplementedCount() == 0; } /** * Gets the number of incomplete tests. */ public function notImplementedCount(): int { return \count($this->notImplemented); } /** * Returns an array of TestFailure objects for the risky tests * * @return TestFailure[] */ public function risky(): array { return $this->risky; } /** * Returns an array of TestFailure objects for the incomplete tests * * @return TestFailure[] */ public function notImplemented(): array { return $this->notImplemented; } /** * Returns true if no test has been skipped. */ public function noneSkipped(): bool { return $this->skippedCount() == 0; } /** * Gets the number of skipped tests. */ public function skippedCount(): int { return \count($this->skipped); } /** * Returns an array of TestFailure objects for the skipped tests * * @return TestFailure[] */ public function skipped(): array { return $this->skipped; } /** * Gets the number of detected errors. */ public function errorCount(): int { return \count($this->errors); } /** * Returns an array of TestFailure objects for the errors * * @return TestFailure[] */ public function errors(): array { return $this->errors; } /** * Gets the number of detected failures. */ public function failureCount(): int { return \count($this->failures); } /** * Returns an array of TestFailure objects for the failures * * @return TestFailure[] */ public function failures(): array { return $this->failures; } /** * Gets the number of detected warnings. */ public function warningCount(): int { return \count($this->warnings); } /** * Returns an array of TestFailure objects for the warnings * * @return TestFailure[] */ public function warnings(): array { return $this->warnings; } /** * Returns the names of the tests that have passed. */ public function passed(): array { return $this->passed; } /** * Returns the (top) test suite. */ public function topTestSuite(): TestSuite { return $this->topTestSuite; } /** * Returns whether code coverage information should be collected. */ public function getCollectCodeCoverageInformation(): bool { return $this->codeCoverage !== null; } /** * Runs a TestCase. * * @throws CodeCoverageException * @throws OriginalCoveredCodeNotExecutedException * @throws OriginalMissingCoversAnnotationException * @throws UnintentionallyCoveredCodeException * @throws \ReflectionException * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws \SebastianBergmann\CodeCoverage\RuntimeException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ public function run(Test $test): void { Assert::resetCount(); $coversNothing = false; if ($test instanceof TestCase) { $test->setRegisterMockObjectsFromTestArgumentsRecursively( $this->registerMockObjectsFromTestArgumentsRecursively ); $isAnyCoverageRequired = self::isAnyCoverageRequired($test); } $error = false; $failure = false; $warning = false; $incomplete = false; $risky = false; $skipped = false; $this->startTest($test); $errorHandlerSet = false; if ($this->convertErrorsToExceptions) { $oldErrorHandler = \set_error_handler( [ErrorHandler::class, 'handleError'], \E_ALL | \E_STRICT ); if ($oldErrorHandler === null) { $errorHandlerSet = true; } else { \restore_error_handler(); } } $collectCodeCoverage = $this->codeCoverage !== null && !$test instanceof WarningTestCase && $isAnyCoverageRequired; if ($collectCodeCoverage) { $this->codeCoverage->start($test); } $monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests && !$test instanceof WarningTestCase && $test->getSize() == \PHPUnit\Util\Test::SMALL && \function_exists('xdebug_start_function_monitor'); if ($monitorFunctions) { /* @noinspection ForgottenDebugOutputInspection */ \xdebug_start_function_monitor(ResourceOperations::getFunctions()); } Timer::start(); try { if (!$test instanceof WarningTestCase && $this->enforceTimeLimit && ($this->defaultTimeLimit || $test->getSize() != \PHPUnit\Util\Test::UNKNOWN) && \extension_loaded('pcntl') && \class_exists(Invoker::class)) { switch ($test->getSize()) { case \PHPUnit\Util\Test::SMALL: $_timeout = $this->timeoutForSmallTests; break; case \PHPUnit\Util\Test::MEDIUM: $_timeout = $this->timeoutForMediumTests; break; case \PHPUnit\Util\Test::LARGE: $_timeout = $this->timeoutForLargeTests; break; case \PHPUnit\Util\Test::UNKNOWN: $_timeout = $this->defaultTimeLimit; break; } $invoker = new Invoker; $invoker->invoke([$test, 'runBare'], [], $_timeout); } else { $test->runBare(); } } catch (TimeoutException $e) { $this->addFailure( $test, new RiskyTestError( $e->getMessage() ), $_timeout ); $risky = true; } catch (MockObjectException $e) { $e = new Warning( $e->getMessage() ); $warning = true; } catch (AssertionFailedError $e) { $failure = true; if ($e instanceof RiskyTestError) { $risky = true; } elseif ($e instanceof IncompleteTestError) { $incomplete = true; } elseif ($e instanceof SkippedTestError) { $skipped = true; } } catch (AssertionError $e) { $test->addToAssertionCount(1); $failure = true; $frame = $e->getTrace()[0]; $e = new AssertionFailedError( \sprintf( '%s in %s:%s', $e->getMessage(), $frame['file'], $frame['line'] ) ); } catch (Warning $e) { $warning = true; } catch (Exception $e) { $error = true; } catch (Throwable $e) { $e = new ExceptionWrapper($e); $error = true; } $time = Timer::stop(); $test->addToAssertionCount(Assert::getCount()); if ($monitorFunctions) { $blacklist = new Blacklist; /** @noinspection ForgottenDebugOutputInspection */ $functions = \xdebug_get_monitored_functions(); /* @noinspection ForgottenDebugOutputInspection */ \xdebug_stop_function_monitor(); foreach ($functions as $function) { if (!$blacklist->isBlacklisted($function['filename'])) { $this->addFailure( $test, new RiskyTestError( \sprintf( '%s() used in %s:%s', $function['function'], $function['filename'], $function['lineno'] ) ), $time ); } } } if ($this->beStrictAboutTestsThatDoNotTestAnything && $test->getNumAssertions() == 0) { $risky = true; } if ($collectCodeCoverage) { $append = !$risky && !$incomplete && !$skipped; $linesToBeCovered = []; $linesToBeUsed = []; if ($append && $test instanceof TestCase) { try { $linesToBeCovered = \PHPUnit\Util\Test::getLinesToBeCovered( \get_class($test), $test->getName(false) ); $linesToBeUsed = \PHPUnit\Util\Test::getLinesToBeUsed( \get_class($test), $test->getName(false) ); } catch (InvalidCoversTargetException $cce) { $this->addWarning( $test, new Warning( $cce->getMessage() ), $time ); } } try { $this->codeCoverage->stop( $append, $linesToBeCovered, $linesToBeUsed ); } catch (UnintentionallyCoveredCodeException $cce) { $this->addFailure( $test, new UnintentionallyCoveredCodeError( 'This test executed code that is not listed as code to be covered or used:' . \PHP_EOL . $cce->getMessage() ), $time ); } catch (OriginalCoveredCodeNotExecutedException $cce) { $this->addFailure( $test, new CoveredCodeNotExecutedException( 'This test did not execute all the code that is listed as code to be covered:' . \PHP_EOL . $cce->getMessage() ), $time ); } catch (OriginalMissingCoversAnnotationException $cce) { if ($linesToBeCovered !== false) { $this->addFailure( $test, new MissingCoversAnnotationException( 'This test does not have a @covers annotation but is expected to have one' ), $time ); } } catch (OriginalCodeCoverageException $cce) { $error = true; $e = $e ?? $cce; } } if ($errorHandlerSet === true) { \restore_error_handler(); } if ($error === true) { $this->addError($test, $e, $time); } elseif ($failure === true) { $this->addFailure($test, $e, $time); } elseif ($warning === true) { $this->addWarning($test, $e, $time); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && !$test->doesNotPerformAssertions() && $test->getNumAssertions() == 0) { $reflected = new \ReflectionClass($test); $name = $test->getName(false); if ($name && $reflected->hasMethod($name)) { $reflected = $reflected->getMethod($name); } $this->addFailure( $test, new RiskyTestError(\sprintf( "This test did not perform any assertions\n\n%s:%d", $reflected->getFileName(), $reflected->getStartLine() )), $time ); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && $test->doesNotPerformAssertions() && $test->getNumAssertions() > 0) { $this->addFailure( $test, new RiskyTestError(\sprintf( 'This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', $test->getNumAssertions() )), $time ); } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) { $this->addFailure( $test, new OutputError( \sprintf( 'This test printed output: %s', $test->getActualOutput() ) ), $time ); } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof TestCase) { $annotations = $test->getAnnotations(); if (isset($annotations['method']['todo'])) { $this->addFailure( $test, new RiskyTestError( 'Test method is annotated with @todo' ), $time ); } } $this->endTest($test, $time); } /** * Gets the number of run tests. */ public function count(): int { return $this->runTests; } /** * Checks whether the test run should stop. */ public function shouldStop(): bool { return $this->stop; } /** * Marks that the test run should stop. */ public function stop(): void { $this->stop = true; } /** * Returns the code coverage object. */ public function getCodeCoverage(): ?CodeCoverage { return $this->codeCoverage; } /** * Sets the code coverage object. */ public function setCodeCoverage(CodeCoverage $codeCoverage): void { $this->codeCoverage = $codeCoverage; } /** * Enables or disables the error-to-exception conversion. */ public function convertErrorsToExceptions(bool $flag): void { $this->convertErrorsToExceptions = $flag; } /** * Returns the error-to-exception conversion setting. */ public function getConvertErrorsToExceptions(): bool { return $this->convertErrorsToExceptions; } /** * Enables or disables the stopping when an error occurs. */ public function stopOnError(bool $flag): void { $this->stopOnError = $flag; } /** * Enables or disables the stopping when a failure occurs. */ public function stopOnFailure(bool $flag): void { $this->stopOnFailure = $flag; } /** * Enables or disables the stopping when a warning occurs. */ public function stopOnWarning(bool $flag): void { $this->stopOnWarning = $flag; } public function beStrictAboutTestsThatDoNotTestAnything(bool $flag): void { $this->beStrictAboutTestsThatDoNotTestAnything = $flag; } public function isStrictAboutTestsThatDoNotTestAnything(): bool { return $this->beStrictAboutTestsThatDoNotTestAnything; } public function beStrictAboutOutputDuringTests(bool $flag): void { $this->beStrictAboutOutputDuringTests = $flag; } public function isStrictAboutOutputDuringTests(): bool { return $this->beStrictAboutOutputDuringTests; } public function beStrictAboutResourceUsageDuringSmallTests(bool $flag): void { $this->beStrictAboutResourceUsageDuringSmallTests = $flag; } public function isStrictAboutResourceUsageDuringSmallTests(): bool { return $this->beStrictAboutResourceUsageDuringSmallTests; } public function enforceTimeLimit(bool $flag): void { $this->enforceTimeLimit = $flag; } public function enforcesTimeLimit(): bool { return $this->enforceTimeLimit; } public function beStrictAboutTodoAnnotatedTests(bool $flag): void { $this->beStrictAboutTodoAnnotatedTests = $flag; } public function isStrictAboutTodoAnnotatedTests(): bool { return $this->beStrictAboutTodoAnnotatedTests; } /** * Enables or disables the stopping for risky tests. */ public function stopOnRisky(bool $flag): void { $this->stopOnRisky = $flag; } /** * Enables or disables the stopping for incomplete tests. */ public function stopOnIncomplete(bool $flag): void { $this->stopOnIncomplete = $flag; } /** * Enables or disables the stopping for skipped tests. */ public function stopOnSkipped(bool $flag): void { $this->stopOnSkipped = $flag; } /** * Enables or disables the stopping for defects: error, failure, warning */ public function stopOnDefect(bool $flag): void { $this->stopOnDefect = $flag; } /** * Returns the time spent running the tests. */ public function time(): float { return $this->time; } /** * Returns whether the entire test was successful or not. */ public function wasSuccessful(): bool { return $this->wasSuccessfulIgnoringWarnings() && empty($this->warnings); } public function wasSuccessfulIgnoringWarnings(): bool { return empty($this->errors) && empty($this->failures); } /** * Sets the default timeout for tests */ public function setDefaultTimeLimit(int $timeout): void { $this->defaultTimeLimit = $timeout; } /** * Sets the timeout for small tests. */ public function setTimeoutForSmallTests(int $timeout): void { $this->timeoutForSmallTests = $timeout; } /** * Sets the timeout for medium tests. */ public function setTimeoutForMediumTests(int $timeout): void { $this->timeoutForMediumTests = $timeout; } /** * Sets the timeout for large tests. */ public function setTimeoutForLargeTests(int $timeout): void { $this->timeoutForLargeTests = $timeout; } /** * Returns the set timeout for large tests. */ public function getTimeoutForLargeTests(): int { return $this->timeoutForLargeTests; } public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag): void { $this->registerMockObjectsFromTestArgumentsRecursively = $flag; } }