Merge pull request #4913 from tobiasd/20180423-phpunit

phpunit compat 5.6 vs 7.x
This commit is contained in:
Hypolite Petovan 2018-04-23 08:00:13 -04:00 committed by GitHub
commit 2f024a3a6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View file

@ -7,12 +7,14 @@ namespace Friendica\Test;
use Friendica\App; use Friendica\App;
use Friendica\BaseObject; use Friendica\BaseObject;
use PHPUnit_Framework_TestCase; // backward compatibility
if (!class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}
/** /**
* Tests for the BaseObject class. * Tests for the BaseObject class.
*/ */
class BaseObjectTest extends PHPUnit_Framework_TestCase class BaseObjectTest extends \PHPUnit\Framework\TestCase
{ {
/** /**

View file

@ -5,12 +5,15 @@
namespace Friendica\Test; namespace Friendica\Test;
use PHPUnit_Framework_TestCase; // backward compatibility
if (!class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}
/** /**
* Tests for text functions. * Tests for text functions.
*/ */
class TextTest extends PHPUnit_Framework_TestCase class TextTest extends \PHPUnit\Framework\TestCase
{ {
/** /**
@ -61,10 +64,10 @@ class TextTest extends PHPUnit_Framework_TestCase
public function testAutonameLength1() public function testAutonameLength1()
{ {
$autoname1=autoname(1); $autoname1=autoname(1);
$this->assertEquals(1, count($autoname1)); $this->assertEquals(1, strlen($autoname1));
$autoname2=autoname(1); $autoname2=autoname(1);
$this->assertEquals(1, count($autoname2)); $this->assertEquals(1, strlen($autoname2));
} }
/** /**