Fix the failing unit tests
refactor the codestyle for the tests we wanted to keep
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] e5fb1777708efe70c0e9573bd3d7b4f7
|
||||
<?php //[STAMP] e5c8b753550e51a399c3237c77520b8f
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
@@ -20,14 +20,29 @@ trait UnitTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are equal.
|
||||
* Checks that two variables are equal. If you're comparing floating-point values,
|
||||
* you can specify the optional "delta" parameter which dictates how great of a precision
|
||||
* error are you willing to tolerate in order to consider the two values equal.
|
||||
*
|
||||
* Regular example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->assertEquals($element->getChildrenCount(), 5);
|
||||
* ```
|
||||
*
|
||||
* Floating-point example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->assertEquals($calculator->add(0.1, 0.2), 0.3, 'Calculator should add the two numbers correctly.', 0.01);
|
||||
* ```
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @param float $delta
|
||||
* @see \Codeception\Module\Asserts::assertEquals()
|
||||
*/
|
||||
public function assertEquals($expected, $actual, $message = null) {
|
||||
public function assertEquals($expected, $actual, $message = null, $delta = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -35,14 +50,29 @@ trait UnitTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that two variables are not equal
|
||||
* Checks that two variables are not equal. If you're comparing floating-point values,
|
||||
* you can specify the optional "delta" parameter which dictates how great of a precision
|
||||
* error are you willing to tolerate in order to consider the two values not equal.
|
||||
*
|
||||
* Regular example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->assertNotEquals($element->getChildrenCount(), 0);
|
||||
* ```
|
||||
*
|
||||
* Floating-point example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->assertNotEquals($calculator->add(0.1, 0.2), 0.4, 'Calculator should add the two numbers correctly.', 0.01);
|
||||
* ```
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
* @param float $delta
|
||||
* @see \Codeception\Module\Asserts::assertNotEquals()
|
||||
*/
|
||||
public function assertNotEquals($expected, $actual, $message = null) {
|
||||
public function assertNotEquals($expected, $actual, $message = null, $delta = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -92,17 +122,6 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThen()
|
||||
*/
|
||||
public function assertGreaterThen($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -118,17 +137,6 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
|
||||
*/
|
||||
public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -219,6 +227,36 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that a string starts with the given prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param string $string
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertStringStartsWith()
|
||||
*/
|
||||
public function assertStringStartsWith($prefix, $string, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that a string doesn't start with the given prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param string $string
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertStringStartsNotWith()
|
||||
*/
|
||||
public function assertStringStartsNotWith($prefix, $string, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -334,13 +372,93 @@ trait UnitTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Fails the test with message.
|
||||
*
|
||||
* @param $message
|
||||
* @see \Codeception\Module\Asserts::fail()
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertGreaterOrEquals()
|
||||
*/
|
||||
public function fail($message) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
||||
public function assertGreaterOrEquals($expected, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertLessOrEquals()
|
||||
*/
|
||||
public function assertLessOrEquals($expected, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertIsEmpty()
|
||||
*/
|
||||
public function assertIsEmpty($actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $key
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertArrayHasKey()
|
||||
*/
|
||||
public function assertArrayHasKey($key, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $key
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertArrayNotHasKey()
|
||||
*/
|
||||
public function assertArrayNotHasKey($key, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that array contains subset.
|
||||
*
|
||||
* @param array $subset
|
||||
* @param array $array
|
||||
* @param bool $strict
|
||||
* @param string $message
|
||||
* @see \Codeception\Module\Asserts::assertArraySubset()
|
||||
*/
|
||||
public function assertArraySubset($subset, $array, $strict = null, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArraySubset', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $expectedCount
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertCount()
|
||||
*/
|
||||
public function assertCount($expectedCount, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
@@ -357,6 +475,79 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $class
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertNotInstanceOf()
|
||||
*/
|
||||
public function assertNotInstanceOf($class, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $type
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertInternalType()
|
||||
*/
|
||||
public function assertInternalType($type, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Fails the test with message.
|
||||
*
|
||||
* @param $message
|
||||
* @see \Codeception\Module\Asserts::fail()
|
||||
*/
|
||||
public function fail($message) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Handles and checks exception called inside callback function.
|
||||
* Either exception class name or exception instance should be provided.
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->expectException(MyException::class, function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
*
|
||||
* $I->expectException(new MyException(), function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
* ```
|
||||
* If you want to check message or exception code, you can pass them with exception instance:
|
||||
* ```php
|
||||
* <?php
|
||||
* // will check that exception MyException is thrown with "Don't do bad things" message
|
||||
* $I->expectException(new MyException("Don't do bad things"), function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param $exception string or \Exception
|
||||
* @param $callback
|
||||
* @see \Codeception\Module\Asserts::expectException()
|
||||
*/
|
||||
public function expectException($exception, $callback) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user