Пример #1
0
 /**
  * Prepares setup for Tests of "Crypt".
  *
  * @author Benjamin Carl <opensource@clickalicious.de>
  */
 public function setUp()
 {
     self::$serviceName = 'Crypt';
     parent::setUp();
     // Get a faker instance with Doozr's default locale
     $faker = Faker\Factory::create($this->convertLocale(self::$registry->getConfiguration()->i18n->default->locale));
     // Iterate defined key strengths, generate keys in different strength and store it
     foreach (self::$keysByStrengthBit as $keyStrengthBits) {
         $keyStrengthBytes = $keyStrengthBits / 8;
         self::$privateKeys[$keyStrengthBits] = $faker->password($keyStrengthBytes, $keyStrengthBytes);
     }
     // Generate a random text for encryption
     self::$buffer = $faker->realText($faker->numberBetween(10, 4096));
 }
Пример #2
0
 /**
  * Prepares setup for Tests of "I18n".
  *
  * @author Benjamin Carl <opensource@clickalicious.de>
  */
 public function setUp()
 {
     self::$serviceName = 'I18n';
     parent::setUp();
 }
Пример #3
0
 /**
  * Prepares setup for Tests of "Form".
  *
  * @author Benjamin Carl <opensource@clickalicious.de>
  */
 public function setUp()
 {
     self::$serviceName = 'Form';
     /** INIT */
     static $status;
     // Function has already run
     if (null === $status) {
         // Get container instance from registry
         $map = self::$registry->getContainer()->getMap();
         // File containing mappings
         $file = Doozr_Loader_Serviceloader::getServicePath('form') . DIRECTORY_SEPARATOR . '.map.json';
         // Generate map from static JSON map of Doozr
         $map->generate($file);
         // Get container instance from registry
         $container = self::$registry->getContainer();
         // Add map to existing maps in container
         $container->addToMap($map);
         // Create container and set factory and map
         $container->getMap()->wire(['doozr.i18n.service' => Doozr_Loader_Serviceloader::load('i18n'), 'doozr.form.service.store' => new Doozr_Form_Service_Store_UnitTest(), 'doozr.form.service.renderer' => new Doozr_Form_Service_Renderer_Html()]);
         self::$registry->setContainer($container);
         $status = 1;
     }
     /** END INIT */
     parent::setUp();
     // Get a faker instance with Doozr's default locale
     self::$faker = FakerFactory::create($this->convertLocale(self::$registry->getConfiguration()->i18n->default->locale));
 }
Пример #4
0
 /**
  * Cleanup after test execution.
  *
  * @author Benjamin Carl <opensource@clickalicious.de>
  */
 protected function tearDown()
 {
     self::$service = null;
 }