Browse Source

Fixing test suite to run phpunit 6.0

Curtis Farnham 7 years ago
parent
commit
4f472500fe

+ 1 - 1
composer.json

@@ -20,7 +20,7 @@
         }
     ],
     "require": {
-        "php": ">=5.6",
+        "php": ">=7.0 <7.2",
         "ext-openssl": "*"
     },
     "require-dev": {

+ 6 - 2
tests/RNCryptor/CryptorTest.php

@@ -1,7 +1,9 @@
 <?php
 namespace RNCryptor;
 
-class CryptorTest extends \PHPUnit_Framework_TestCase {
+use PHPUnit\Framework\TestCase;
+
+class CryptorTest extends TestCase {
 
 	// relative to __DIR__
 	const TEXT_FILENAME = 'lorem-ipsum.txt';
@@ -124,11 +126,13 @@ class CryptorTest extends \PHPUnit_Framework_TestCase {
   		$this->assertEquals(self::SAMPLE_PLAINTEXT, $decrypted);
   	}
 
+    /**
+     * @expectedException \Exception
+     */
   	public function testCannotUseWithUnsupportedSchemaVersions() {
   		$fakeSchemaNumber = 57;
   		$encrypted = $this->_generateEncryptedStringWithUnsupportedSchemaNumber($fakeSchemaNumber);
   		$decryptor = new Decryptor();
-  		$this->setExpectedException('Exception');
   		$decryptor->decrypt($encrypted, self::SAMPLE_PASSWORD);
   	}
 

+ 3 - 1
tests/RNCryptor/DecryptorTest.php

@@ -1,7 +1,9 @@
 <?php
 namespace RNCryptor;
 
-class DecryptorTest extends \PHPUnit_Framework_TestCase {
+use PHPUnit\Framework\TestCase;
+
+class DecryptorTest extends TestCase {
 
 	const IOS_PASSWORD = 'mypassword123$!';
 

+ 3 - 1
tests/RNCryptor/EncryptorTest.php

@@ -1,7 +1,9 @@
 <?php
 namespace RNCryptor;
 
-class EncryptorTest extends \PHPUnit_Framework_TestCase {
+use PHPUnit\Framework\TestCase;
+
+class EncryptorTest extends TestCase {
 
 	const SAMPLE_PLAINTEXT = 'Hello, how are you today?  I am doing fine.';
 	const SAMPLE_PASSWORD = 'keep-out-123';

+ 3 - 1
tests/RNCryptor/VectorTest.php

@@ -1,7 +1,9 @@
 <?php
 namespace RNCryptor;
 
-class VectorBase extends \PHPUnit_Framework_TestCase {
+use PHPUnit\Framework\TestCase;
+
+class VectorBase extends TestCase {
 
 	/**
 	 * Base directory for the test vector files,