tests/Entity/SnapshotManagerTest.php
/**
     * Tests the enableSnapshots() method to ensure execute queries are not executed when no snapshots are given.
     */
Tests the enableSnapshots() method to ensure execute queries are not executed when no snapshots are given.
Tests the enableSnapshots () method to ensure execute queries are not executed when no snapshots are given .
public function testEnableSnapshotsWhenNoSnapshots(): void
    {
        $connection = $this->createMock(Connection::class);
        $connection->expects(static::never())->method('query');
        $em = $this->createMock(EntityManagerInterface::class);
        $em->expects(static::never())->method('persist');
        $em->expects(static::never())->method('flush');
        $em->expects(static::never())->method('getConnection');
        $manager = $this->getMockBuilder(SnapshotManager::class)
            ->disableOriginalConstructor()
            ->setMethods(['getEntityManager', 'getTableName'])
            ->getMock();
        $manager->expects(static::never())->method('getEntityManager');
        $manager->expects(static::never())->method('getTableName');
        $manager->enableSnapshots([]);
    }
public function testEnableSnapshotsWhenNoSnapshots ( ) : void { $ connection = $ this -> createMock ( Connection :: class ) ; $ connection -> expects ( static :: never ( ) ) -> method ( 'query' ) ; $ em = $ this -> createMock ( EntityManagerInterface :: class ) ; $ em -> expects ( static :: never ( ) ) -> method ( 'persist' ) ; $ em -> expects ( static :: never ( ) ) -> method ( 'flush' ) ; $ em -> expects ( static :: never ( ) ) -> method ( 'getConnection' ) ; $ manager = $ this -> getMockBuilder ( SnapshotManager :: class ) -> disableOriginalConstructor ( ) -> setMethods ( [ 'getEntityManager' , 'getTableName' ] ) -> getMock ( ) ; $ manager -> expects ( static :: never ( ) ) -> method ( 'getEntityManager' ) ; $ manager -> expects ( static :: never ( ) ) -> method ( 'getTableName' ) ; $ manager -> enableSnapshots ( [ ] ) ; }
Tests the enableSnapshots() method to ensure execute queries are not executed when no snapshots are given.
Tests the enableSnapshots () method to ensure execute queries are not executed when no snapshots are given .
// When calling method, do not expects any calls