Code Duplication    Length = 23-23 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/Tests/TransactionHandlerTest.php 2 locations

@@ 78-100 (lines=23) @@
75
    /**
76
     * @covers \eZ\Publish\Core\Persistence\Cache\TransactionHandler::commit
77
     */
78
    public function testCommitStopsCacheTransaction()
79
    {
80
        $this->loggerMock
81
            ->expects($this->once())
82
            ->method('logCall');
83
84
        $this->cacheMock
85
            ->expects($this->once())
86
            ->method('stopTransaction');
87
88
        $innerHandlerMock = $this->createMock(TransactionHandler::class);
89
        $this->persistenceHandlerMock
90
            ->expects($this->once())
91
            ->method('transactionHandler')
92
            ->will($this->returnValue($innerHandlerMock));
93
94
        $innerHandlerMock
95
            ->expects($this->once())
96
            ->method('commit');
97
98
        $handler = $this->persistenceCacheHandler->transactionHandler();
99
        $handler->commit();
100
    }
101
102
    /**
103
     * @covers \eZ\Publish\Core\Persistence\Cache\TransactionHandler::beginTransaction
@@ 105-127 (lines=23) @@
102
    /**
103
     * @covers \eZ\Publish\Core\Persistence\Cache\TransactionHandler::beginTransaction
104
     */
105
    public function testBeginTransactionStartsCacheTransaction()
106
    {
107
        $this->loggerMock
108
            ->expects($this->once())
109
            ->method('logCall');
110
111
        $this->cacheMock
112
            ->expects($this->once())
113
            ->method('startTransaction');
114
115
        $innerHandlerMock = $this->createMock(TransactionHandler::class);
116
        $this->persistenceHandlerMock
117
            ->expects($this->once())
118
            ->method('transactionHandler')
119
            ->will($this->returnValue($innerHandlerMock));
120
121
        $innerHandlerMock
122
            ->expects($this->once())
123
            ->method('beginTransaction');
124
125
        $handler = $this->persistenceCacheHandler->transactionHandler();
126
        $handler->beginTransaction();
127
    }
128
}
129