@@ 11-36 (lines=26) @@ | ||
8 | ||
9 | final class CommitTest extends AbstractEntityManagerTest |
|
10 | { |
|
11 | public function testSimpleCommit() |
|
12 | { |
|
13 | $entity = new TestReference(); |
|
14 | ||
15 | $this->getClient('test-reference-client')->push( |
|
16 | $this->getResponseMock(true, 241), |
|
17 | function (RpcRequestInterface $request) { |
|
18 | self::assertEquals('test-reference/create', $request->getMethod()); |
|
19 | self::assertEquals( |
|
20 | [ |
|
21 | 'reference-payload' => '', |
|
22 | 'owner' => null, |
|
23 | ], |
|
24 | $request->getParameters() |
|
25 | ); |
|
26 | ||
27 | return true; |
|
28 | } |
|
29 | ); |
|
30 | ||
31 | $this->getManager()->persist($entity); |
|
32 | $this->getManager()->flush(); |
|
33 | ||
34 | self::assertNotNull($entity->getId()); |
|
35 | self::assertEquals(241, $entity->getId()); |
|
36 | } |
|
37 | ||
38 | public function testExtendedIdIsSameAsSimpleCommit() |
|
39 | { |
|
@@ 38-63 (lines=26) @@ | ||
35 | self::assertEquals(241, $entity->getId()); |
|
36 | } |
|
37 | ||
38 | public function testExtendedIdIsSameAsSimpleCommit() |
|
39 | { |
|
40 | $entity = new TestReference(); |
|
41 | ||
42 | $this->getClient('test-reference-client')->push( |
|
43 | $this->getResponseMock(true, ['id' => 241]), |
|
44 | function (RpcRequestInterface $request) { |
|
45 | self::assertEquals('test-reference/create', $request->getMethod()); |
|
46 | self::assertEquals( |
|
47 | [ |
|
48 | 'reference-payload' => '', |
|
49 | 'owner' => null, |
|
50 | ], |
|
51 | $request->getParameters() |
|
52 | ); |
|
53 | ||
54 | return true; |
|
55 | } |
|
56 | ); |
|
57 | ||
58 | $this->getManager()->persist($entity); |
|
59 | $this->getManager()->flush(); |
|
60 | ||
61 | self::assertNotNull($entity->getId()); |
|
62 | self::assertEquals(241, $entity->getId()); |
|
63 | } |
|
64 | ||
65 | public function testChainCommitWithRelation() |
|
66 | { |