Code Duplication    Length = 16-22 lines in 2 locations

tests/TDBMDaoGeneratorTest.php 2 locations

@@ 199-214 (lines=16) @@
196
    /**
197
     * @depends testDaoGeneration
198
     */
199
    public function testForeignKeyInBean()
200
    {
201
        $userDao = new UserDao($this->tdbmService);
202
        $userBean = $userDao->getById(1);
203
        $country = $userBean->getCountry();
204
205
        $this->assertEquals('UK', $country->getLabel());
206
207
        $userBean2 = $userDao->getById(1);
208
        $this->assertTrue($userBean === $userBean2);
209
210
        $contactDao = new ContactDao($this->tdbmService);
211
        $contactBean = $contactDao->getById(1);
212
213
        $this->assertTrue($userBean === $contactBean);
214
    }
215
216
    /**
217
     * @depends testDaoGeneration
@@ 564-585 (lines=22) @@
561
     *
562
     * @depends testJointureSave7
563
     */
564
    public function testJointureSave8()
565
    {
566
        $roleDao = new RoleDao($this->tdbmService);
567
        $userDao = new UserDao($this->tdbmService);
568
        $user = $userDao->getById(1);
569
570
        $roles = $user->getRoles();
571
        foreach ($roles as $role) {
572
            if ($role->getName() === 'my new role') {
573
                $selectedRole = $role;
574
                break;
575
            }
576
        }
577
        $this->assertNotNull($selectedRole);
578
579
        $this->assertCount(2, $user->getRoles());
580
581
        // Expected: relationship removed!
582
        $roleDao->delete($selectedRole);
583
584
        $this->assertCount(1, $user->getRoles());
585
    }
586
587
    /**
588
     * Step 9: Let's test the setXXX method.