# Repository Mock - StaticEntityRepository on flex template

**URL:** https://forum.shopware.com/t/repository-mock-staticentityrepository-on-flex-template/98968
**Category:** Programming (EN)
**Created:** [16. März 2023 um 10:41 UTC](https://forum.shopware.com/t/repository-mock-staticentityrepository-on-flex-template/98968 "2023-03-16T10:41:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kl-ffit](https://avatars.discourse-cdn.com/v4/letter/k/e56c9b/32.png) [@kl-ffit](https://forum.shopware.com/u/kl-ffit)
#### Post date: [16. März 2023 um 10:41 UTC](https://forum.shopware.com/t/repository-mock-staticentityrepository-on-flex-template/98968/1 "2023-03-16T10:41:23Z")

</div>

Hey. I’m developing a plugin using the flex template and wanted to write some tests with PHPUnit.  
I’m having problem with mocking repositories. Wanted to follow this guide in docks, as it looks pretty simple.

> **[Mocking repositories](https://developer.shopware.com/docs/v/6.4/resources/references/adr/testing/2023-04-01-mocking-repositories)**

Sadly the class `Shopware\Tests\Unit\Common\Stubs\DataAbstractionLayer\StaticEntityRepository ` seems to be not implemented in this template.  
Ist there a way to use it on flex? Or do I need to use the PHPUnit mocks, like in the first example in the docs?
