/** * @test */ public function loadMetadataCreateNewClassMetadata() { $expectedResult = new ClassMetadata\ClassMetadata('Kassko\\DataMapperTest\\ClassMetadata\\Fixture\\SampleClass'); $cacheKey = 'testCacheKey'; $this->objectKeyMock->expects($this->once())->method('getKey')->willReturn($cacheKey); $this->objectKeyMock->expects($this->once())->method('getClass')->willReturn('Kassko\\DataMapperTest\\ClassMetadata\\Fixture\\SampleClass'); $this->loaderMock->expects($this->once())->method('loadClassMetadata')->with($expectedResult, $this->loadingCriteriaMock, $this->configurationMock); $this->cacheMock->expects($this->once())->method('save')->with($cacheKey); $this->eventDispatcherMock->expects($this->once())->method('dispatch')->with(ClassMetadata\Events::POST_LOAD_METADATA); $result = $this->classMetadataFactory->loadMetadata($this->objectKeyMock, $this->loadingCriteriaMock, $this->configurationMock); $this->assertEquals($expectedResult, $result); }
/** * @test * @dataProvider deleteDataProvider * @param mixed $id */ public function deleteValidateData($id) { $this->cache->delete($id); $this->assertFalse($this->cache->contains($id)); }