Support for PHP infection testing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-11-03 13:29:50 +00:00
parent 66ccb3d8d6
commit bedc666f7c
11 changed files with 115 additions and 30 deletions

View File

@ -15,14 +15,23 @@ final class CommandBackupTest extends \PHPUnit\Framework\TestCase
{
protected function setUp(): void
{
mkdir('temp');
mkdir('temp/destination');
exec('rclone test makefiles temp/source 2>&1');
if (!is_dir('temp')) {
mkdir('temp');
}
if (!is_dir('temp/destination')) {
mkdir('temp/destination');
}
exec('rclone test makefiles --files 10 temp/source 2>&1');
}
protected function tearDown(): void
{
exec('rclone purge temp 2>&1');
if (is_dir('temp/destination')) {
rmdir('temp/destination');
}
if (is_dir("temp")) {
rmdir('temp');
}

View File

@ -42,7 +42,7 @@ final class NtfyTest extends TestCase
public function testSendLong(): void
{
$this->client->expects($this->once())->method('send')->with($this->isInstanceOf(Message::class));
$this->instance->send(str_repeat("t", Ntfy::TOPIC_MAX_LENGTH), str_repeat("t", Ntfy::MESSAGE_MAX_LENGTH));
$this->instance->send(str_repeat("t", Ntfy::TITLE_MAX_LENGTH), str_repeat("t", Ntfy::MESSAGE_MAX_LENGTH));
}
/** @return array<int, array<int, string>> */
@ -52,8 +52,8 @@ final class NtfyTest extends TestCase
['', ''],
['', 'text'],
['title', ''],
[str_repeat("t", Ntfy::TOPIC_MAX_LENGTH+1),'text'],
['title',str_repeat("t", Ntfy::MESSAGE_MAX_LENGTH+1)],
[str_repeat("t", Ntfy::TITLE_MAX_LENGTH + 1), 'text'],
['title',str_repeat("t", Ntfy::MESSAGE_MAX_LENGTH + 1)],
];
}
@ -80,8 +80,7 @@ final class NtfyTest extends TestCase
{
return [
[''],
[str_repeat("t", Ntfy::TOPIC_MAX_LENGTH+1)],
[str_repeat("t", Ntfy::MESSAGE_MAX_LENGTH+1)],
[str_repeat("t", Ntfy::TOPIC_MAX_LENGTH + 1)],
];
}