fix test deprecations

This commit is contained in:
Yuri Kuznetsov
2025-07-09 10:43:05 +03:00
parent cd7307c9f6
commit ee0bfb5970
6 changed files with 108 additions and 139 deletions
@@ -31,23 +31,24 @@ namespace tests\unit\Espo\ORM\Repository;
require_once 'tests/unit/testData/DB/Entities.php';
use Espo\ORM\{
Repository\RDBTransactionManager,
TransactionManager,
};
use Espo\ORM\Repository\RDBTransactionManager;
use Espo\ORM\TransactionManager;
use PHPUnit\Framework\TestCase;
use RuntimeException;
class RDBTransactionManagerTest extends \PHPUnit\Framework\TestCase
class RDBTransactionManagerTest extends TestCase
{
protected function setUp() : void
private $wrappee;
private $manager;
protected function setUp(): void
{
$this->wrappee = $this->getMockBuilder(TransactionManager::class)->disableOriginalConstructor()->getMock();
$this->wrappee = $this->createMock(TransactionManager::class);
$this->manager = new RDBTransactionManager($this->wrappee);
}
public function testStartOnce()
{
@@ -67,7 +68,7 @@ class RDBTransactionManagerTest extends \PHPUnit\Framework\TestCase
$this->wrappee
->expects($this->once())
->method('getLevel')
->will($this->returnValue(1));
->willReturn(1);
$this->expectException(RuntimeException::class);