Skip to content

Commit

Permalink
Merge pull request #191 from owncloud/phpunit-8
Browse files Browse the repository at this point in the history
Implement phpunit v8
  • Loading branch information
phil-davis authored Apr 27, 2020
2 parents f3e4586 + 0860e68 commit a29683a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions tests/unit/Command/FixEncryptedVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ public function testEncryptedVersionIsNotZero() {

$output = $this->commandTester->getDisplay();

$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
Attempting to fix the path: /test_enc_version_affected_user1/files/hello.txt
Increment the encrypted version to 1
The file /test_enc_version_affected_user1/files/hello.txt is: OK
Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 1", $output);
$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
The file /test_enc_version_affected_user1/files/world.txt is: OK", $output);
/**
* We need to add ob_start at the end because if not done, it would be considered as a risky test.
Expand Down Expand Up @@ -190,9 +190,9 @@ public function testEncryptedVersionLessThanOriginalValue() {

$output = $this->commandTester->getDisplay();

$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/foo.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/foo.txt
The file /test_enc_version_affected_user1/files/foo.txt is: OK", $output);
$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
Attempting to fix the path: /test_enc_version_affected_user1/files/hello.txt
Decrement the encrypted version to 1
Increment the encrypted version to 3
Expand All @@ -201,7 +201,7 @@ public function testEncryptedVersionLessThanOriginalValue() {
Increment the encrypted version to 6
The file /test_enc_version_affected_user1/files/hello.txt is: OK
Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 6", $output);
$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
Attempting to fix the path: /test_enc_version_affected_user1/files/world.txt
Increment the encrypted version to 2
Increment the encrypted version to 3
Expand Down Expand Up @@ -262,9 +262,9 @@ public function testEncryptedVersionGreaterThanOriginalValue() {

$output = $this->commandTester->getDisplay();

$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/foo.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/foo.txt
The file /test_enc_version_affected_user1/files/foo.txt is: OK", $output);
$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/hello.txt
Attempting to fix the path: /test_enc_version_affected_user1/files/hello.txt
Decrement the encrypted version to 14
Decrement the encrypted version to 13
Expand All @@ -274,7 +274,7 @@ public function testEncryptedVersionGreaterThanOriginalValue() {
Decrement the encrypted version to 9
The file /test_enc_version_affected_user1/files/hello.txt is: OK
Fixed the file: /test_enc_version_affected_user1/files/hello.txt with version 9", $output);
$this->assertContains("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
$this->assertStringContainsString("Verifying the content of file /test_enc_version_affected_user1/files/world.txt
Attempting to fix the path: /test_enc_version_affected_user1/files/world.txt
Decrement the encrypted version to 14
Decrement the encrypted version to 13
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Panels/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ public function testGetPriority() {

public function testGetPanel() {
$templateHtml = $this->panel->getPanel()->fetchPage();
$this->assertContains('<form id="ocDefaultEncryptionModule" class="sub-section">', $templateHtml);
$this->assertStringContainsString('<form id="ocDefaultEncryptionModule" class="sub-section">', $templateHtml);
}
}
2 changes: 1 addition & 1 deletion tests/unit/Panels/PersonalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ public function testGetPanel() {
$mockUser->expects($this->once())->method('getUID')->willReturn('testUser');
$this->userSession->expects($this->once())->method('getUser')->willReturn($mockUser);
$templateHtml = $this->panel->getPanel()->fetchPage();
$this->assertContains('<form id="ocDefaultEncryptionModule" class="section">', $templateHtml);
$this->assertStringContainsString('<form id="ocDefaultEncryptionModule" class="section">', $templateHtml);
}
}
4 changes: 2 additions & 2 deletions vendor-bin/behat/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config" : {
"platform": {
"php": "7.1.3"
"php": "7.2"
}
},
"require": {
Expand All @@ -16,6 +16,6 @@
"symfony/translation": "^4.4",
"sabre/xml": "^2.2",
"guzzlehttp/guzzle": "^6.5",
"phpunit/phpunit": "^7.5"
"phpunit/phpunit": "^8.5"
}
}

0 comments on commit a29683a

Please sign in to comment.