Neos\Flow\Persistence\Generic\PersistenceManager::tearDown PHP 메소드

tearDown() 공개 메소드

This method is called in functional tests to reset the storage between tests. The implementation is optional and depends on the underlying persistence backend.
public tearDown ( ) : void
리턴 void
    public function tearDown()
    {
        if (method_exists($this->backend, 'tearDown')) {
            $this->backend->tearDown();
        }
    }

Usage Example

 /**
  * @test
  */
 public function tearDownWithBackendSupportingTearDownDelegatesCallToBackend()
 {
     $methods = array_merge(get_class_methods(Generic\Backend\BackendInterface::class), ['tearDown']);
     $mockBackend = $this->getMockBuilder(Generic\Backend\BackendInterface::class)->setMethods($methods)->getMock();
     $mockBackend->expects($this->once())->method('tearDown');
     $persistenceManager = new Generic\PersistenceManager();
     $persistenceManager->injectBackend($mockBackend);
     $persistenceManager->tearDown();
 }