);
}
-
public function testWithBadUser()
{
$this->expectException(\InvalidArgumentException::class);
$commandTester->execute([
'uid' => self::USERNAME,
]);
- $this->assertContains("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay());
+ $this->assertStringContainsString("User <" . self::USERNAME . "> in unknown", $commandTester->getDisplay());
}
public function testWithCorrectUserWithNoCalendars()
$commandTester->execute([
'uid' => self::USERNAME,
]);
- $this->assertContains("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay());
+ $this->assertStringContainsString("User <" . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay());
}
public function dataExecute()
$commandTester->execute([
'uid' => self::USERNAME,
]);
- $this->assertContains($output, $commandTester->getDisplay());
- $this->assertNotContains(BirthdayService::BIRTHDAY_CALENDAR_URI, $commandTester->getDisplay());
+ $this->assertStringContainsString($output, $commandTester->getDisplay());
+ $this->assertStringNotContainsString(BirthdayService::BIRTHDAY_CALENDAR_URI, $commandTester->getDisplay());
}
}
]);
}
-
public function testMoveWithInexistantCalendar()
{
$this->expectException(\InvalidArgumentException::class);
]);
}
-
+
public function testMoveWithExistingDestinationCalendar()
{
$this->expectException(\InvalidArgumentException::class);
'destinationuid' => 'user2',
]);
- $this->assertContains("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
+ $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
}
public function testMoveWithDestinationNotPartOfGroupAndForce()
'--force' => true
]);
- $this->assertContains("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
+ $this->assertStringContainsString("[OK] Calendar <personal> was moved from user <user> to <user2>", $commandTester->getDisplay());
}
public function dataTestMoveWithCalendarAlreadySharedToDestination(): array
$this->assertEquals(0, $rc);
$output = $this->cmd->getDisplay();
- $this->assertContains("All user-provider associations for provider u2f have been removed", $output);
+ $this->assertStringContainsString("All user-provider associations for provider u2f have been removed", $output);
}
}
]);
$this->assertEquals(1, $rc);
- $this->assertContains("Invalid UID", $this->command->getDisplay());
+ $this->assertStringContainsString("Invalid UID", $this->command->getDisplay());
}
public function testEnableNotSupported() {
]);
$this->assertEquals(2, $rc);
- $this->assertContains("The provider does not support this operation", $this->command->getDisplay());
+ $this->assertStringContainsString("The provider does not support this operation", $this->command->getDisplay());
}
public function testEnabled() {
]);
$this->assertEquals(0, $rc);
- $this->assertContains("Two-factor provider totp disabled for user ricky", $this->command->getDisplay());
+ $this->assertStringContainsString("Two-factor provider totp disabled for user ricky", $this->command->getDisplay());
}
}
]);
$this->assertEquals(1, $rc);
- $this->assertContains("Invalid UID", $this->command->getDisplay());
+ $this->assertStringContainsString("Invalid UID", $this->command->getDisplay());
}
public function testEnableNotSupported() {
]);
$this->assertEquals(2, $rc);
- $this->assertContains("The provider does not support this operation", $this->command->getDisplay());
+ $this->assertStringContainsString("The provider does not support this operation", $this->command->getDisplay());
}
public function testEnabled() {
]);
$this->assertEquals(0, $rc);
- $this->assertContains("Two-factor provider totp enabled for user belle", $this->command->getDisplay());
+ $this->assertStringContainsString("Two-factor provider totp enabled for user belle", $this->command->getDisplay());
}
}
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for all users", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display);
}
public function testEnforceForOneGroup() {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for members of the group(s) twofactorers", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for members of the group(s) twofactorers", $display);
}
public function testEnforceForAllExceptOneGroup() {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for all users, except members of yoloers", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for all users, except members of yoloers", $display);
}
public function testDisableEnforced() {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is not enforced", $display);
+ $this->assertStringContainsString("Two-factor authentication is not enforced", $display);
}
public function testCurrentStateEnabled() {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is enforced for all users", $display);
+ $this->assertStringContainsString("Two-factor authentication is enforced for all users", $display);
}
public function testCurrentStateDisabled() {
$this->assertEquals(0, $rc);
$display = $this->command->getDisplay();
- $this->assertContains("Two-factor authentication is not enforced", $display);
+ $this->assertStringContainsString("Two-factor authentication is not enforced", $display);
}
}
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Invalid UID", $output);
+ $this->assertStringContainsString("Invalid UID", $output);
}
public function testStateNoProvidersActive() {
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Two-factor authentication is not enabled for user eldora", $output);
+ $this->assertStringContainsString("Two-factor authentication is not enabled for user eldora", $output);
}
public function testStateOneProviderActive() {
]);
$output = $this->cmd->getDisplay();
- $this->assertContains("Two-factor authentication is enabled for user mohamed", $output);
+ $this->assertStringContainsString("Two-factor authentication is enabled for user mohamed", $output);
}
}
public function testHeaders() {
$headers = $this->response->getHeaders();
- $this->assertContains('attachment; filename="file"', $headers['Content-Disposition']);
- $this->assertContains('content', $headers['Content-Type']);
+ $this->assertStringContainsString('attachment; filename="file"', $headers['Content-Disposition']);
+ $this->assertStringContainsString('content', $headers['Content-Type']);
}