public function __construct($name = null, array $data = array(), $dataName = '') { $this->faker = \Faker\Factory::create(); if (is_null(self::$password)) { self::$password = $this->faker->password(); } parent::__construct($name, $data, $dataName); }
public function setUp() { $this->manager = $this->getManager(); parent::setUp(); $this->user = $this->userRepository->create(new \App\User(['username' => $this->faker->userName, 'email' => $this->faker->safeEmail, 'password' => $this->faker->password()])); $this->group = $this->groupRepository->create(new \App\Group(['name' => uniqid()])); $this->role = $this->roleRepository->create(new \App\Role(['name' => uniqid(), 'filter' => 'A'])); $this->roleRevoke = $this->roleRepository->create(new \App\Role(['name' => uniqid(), 'filter' => 'R'])); $this->permissionFirst = $this->permissionRepository->create(new \App\Permission(['area' => uniqid(), 'permission' => uniqid(), 'description' => 'test'])); $this->permissionSecond = $this->permissionRepository->create(new \App\Permission(['area' => uniqid(), 'permission' => uniqid(), 'description' => 'test'])); $this->initiate(); }
public function testAddPermissionTwice() { $permission = \App\Permission::create(['area' => uniqid(), 'permission' => uniqid(), 'description' => uniqid()]); $user = $this->repository->create(new \App\User(['username' => $this->faker->userName, 'email' => $this->faker->safeEmail, 'password' => $this->faker->password()])); $this->assertModel($user, true); $this->repository->addPermission($user, $permission); $this->repository->addPermission($user, $permission); }
public function testPasswordIsValid() { $this->assertRegexp('/^.{6}$/', $this->faker->password(6, 6)); }
/** * Generate a password * * @return string */ public function password() { return $this->faker->password(); }