Exemple #1
0
 public static function createRandomTestUserProfile(User $user = null)
 {
     $testData = self::$testData;
     unset($testData['id']);
     $testData['user'] = null === $user ? UserTest::createRandomTestUser() : $user;
     $testData['firstName'] .= substr(sha1(mt_rand()), 0, 4);
     $testData['lastName'] .= substr(sha1(mt_rand()), 0, 4);
     $testData['socialNetworkIdentities'] = new ArrayCollection(array(UserSocialNetworkIdentityTest::createTestIdentity()));
     $testData['timeZone'] = TimeZoneTest::createRandomTestTimeZone();
     return new UserProfile($testData);
 }
 public function testFindWithNoParametersReturnsAllEntities()
 {
     for ($i = 0; $i < 5; ++$i) {
         self::$entityManager->persist(TimeZoneTest::createRandomTestTimeZone());
     }
     self::$entityManager->flush();
     $entities = TimeZoneService::find();
     $this->assertEquals(5, count($entities));
     foreach ($entities as $entity) {
         $this->assertTrue($entity instanceof TimeZone);
     }
 }