Example #1
0
 /**
  * Print the test footer output
  */
 private function printFooter()
 {
     $footerContent = sprintf('Tests: %d | Assertions: %d | Successful: %d | Failures: %d', $this->numberOfTests, Assert::getCount(), $this->successes, $this->failures);
     $color = $this->failures > 0 ? ColorInterface::RED_BACKGROUND . ColorInterface::WHITE : ColorInterface::GREEN_BACKGROUND . ColorInterface::WHITE;
     $printer = $this->getPrinter();
     $printer->println('');
     $printer->println($printer->colorize($color, $footerContent));
 }
Example #2
0
/**
 * Test if the given value is an instance of the given type
 *
 * @param string $type
 * @param mixed  $actual
 * @param string $message
 * @throws \Cundd\TestFlight\Exception\AssertionError
 */
function test_flight_assert_type(string $type, $actual, string $message = '')
{
    \Cundd\TestFlight\Assert::assertTypeOf($type, $actual, $message);
}
Example #3
0
 /**
  * @test
  */
 protected function getObjectSingletonTest()
 {
     test_flight_assert($this->get(__CLASS__) === $this);
     test_flight_assert($this->get(__CLASS__) === $this->get(__CLASS__));
     test_flight_assert($this->get(__CLASS__) === $this->get(ObjectManager::class));
     test_flight_assert($this->get(__CLASS__) === $this->get('Cundd\\TestFlight\\ObjectManager'));
     Assert::throws(function () {
         $this->get('Not_Existing_Class');
     }, ClassDoesNotExistException::class);
 }