PluginProbe
QuadMenu – Mega Menu / 3.3.8
QuadMenu – Mega Menu v3.3.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / vendor / franmastromarino / wp-orm / tests / Collection / CollectionRepositoryTest.php

CollectionRepositoryTest.php in QuadMenu – Mega Menu 3.3.8, at vendor/franmastromarino/wp-orm/tests/Collection/CollectionRepositoryTest.php

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace QuadLayers\WP_Orm\Tests\Collection\Repository;
4
5 use PHPUnit\Framework\TestCase;
6 use QuadLayers\WP_Orm\Repository\CollectionRepositoryInterface;
7 use QuadLayers\WP_Orm\Tests\Collection\CollectionEntityTest;
8
9 class CollectionRepositoryTest extends TestCase
10 {
11 private CollectionRepositoryInterface $repository;
12
13 protected function setUp(): void
14 {
15 $this->repository = $this->createMock(CollectionRepositoryInterface::class);
16 }
17
18 public function testSave()
19 {
20
21 $entity = new CollectionEntityTest();
22
23 $testValue = $entity->getDefaults();
24
25 $this->repository
26 ->expects($this->once())
27 ->method('create')
28 ->with($testValue)
29 ->willReturn($entity);
30
31 $this->repository->create($testValue);
32 }
33
34 public function testFind()
35 {
36
37 $entity = new CollectionEntityTest();
38
39 $this->repository
40 ->expects($this->once())
41 ->method('find')
42 ->with();
43
44 $this->repository
45 ->expects($this->once())
46 ->method('find')
47 ->willReturn($entity);
48
49 $this->repository->find(0);
50 }
51 }
52