This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl apply -f cronjob.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: print-date | |
spec: | |
schedule: "*/5 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->assertEquals('1', '0', 'check if 1 is 1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->assertRegExp( | |
'/Exception 40\d/', | |
'Exception 501', | |
'Check if it is exception 40x' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->assertEqualsWithDelta(34.3, 34.1, 0.5, '0.5 degree variance in temperature is allowed'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -rin ">assert" . | awk '{print $2}' | awk -F"[>(]" '{print $2}' | sort | uniq -c | sort -nr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function testAssertArrayHasKey() | |
{ | |
$exchangeRates = ['usd' => 0.77, 'euro' => 0.63]; | |
$this->assertArrayHasKey('usd', $exchangeRates, 'Check if USD is available'); | |
$this->assertEquals(0.77, $exchangeRates['usd'], 'Test if USD rate is 0.77'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->assertJsonStringEqualsJsonString( | |
'{"message": "ok"}', | |
json_encode(["message" => "ok"]), | |
'Check message ok json' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was 1 failure: | |
1)FCQN::testAssertEqualsFail | |
check if 1 is 1 | |
Failed asserting that two strings are equal. | |
--- Expected | |
+++ Actual | |
@@ @@ | |
-'1' | |
+'0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->assertStringContainsString( | |
'Error', | |
'Error id is required, the quote is required', | |
'Check if word Error is present' | |
); |