php - PHPUnit test passes nothing to the dependent test

I have two tests:
# it's working correct
/**
* @param $params array
* @param $type bool
* @dataProvider providerA
* @covers \Connections\ConnectionTables::checkForeignParams
* @return bool
*/
public function testA(array $params, bool $type) {
# if in a method expected an exception
if(!$type) {
try {
$this->invokeProtectedMethod('checkForeignParams', [$params]);
$this->fail("Expected Exception has not been raised.");
} catch (\Exception $ex) {
$this->assertEquals("Doesn't correct params", $ex->getMessage());
}
}
# else check that method doesn't return anything
else {
$this->assertNull($this->invokeProtectedMethod('checkForeignParams',[$params]));
}
return $type;
}
public function providerA() {
return [
[
['delete' => 'efwefwe', 'update' => 'wrwerwe'], true
],
[
['delete' => 'erwerwer'], true
]
];
}
And dependent test:
/**
* @param $check_value bool
* @depends testA
* @covers \Connections\ConnectionTables::foreignKey
*/
public function testB(bool $check_value) {
# some logic
}
But I get an error: Argument 1 passed to Tests\Connections\ConnectionTablesTest::testForeignKey() must be of the type bool, null given
Why my test doesn't return anything?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: the payload is invalid.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.