Ejemplo n.º 1
0
 public function test_it_can_get_rule_param_map()
 {
     $rules = $this->PermissionsRepository->availableRulesList();
     $results = $this->PermissionsRepository->getRuleParamMap($rules);
     assertInternalType('array', $results);
     assertEquals(1, $results['hasEmail']);
 }
Ejemplo n.º 2
0
 /**
  * @todo come back to testing this...
  */
 public function test_it_can_compile_index_data()
 {
     $this->Request->shouldReceive('url')->andReturn('someUrl');
     $this->Filesystem->shouldReceive('exists')->once()->andReturn(true)->shouldReceive('directories')->once()->andReturnSelf()->shouldReceive('files')->once()->andReturnSelf();
     $output = $this->Repository->compileIndexData(['capable' => true]);
     assertInternalType('array', $output);
     assertArrayHasKey('crumbs', $output);
     assertArrayHasKey('categories', $output);
     assertArrayHasKey('media-items', $output);
     assertArrayHasKey('searched-items', $output);
 }
Ejemplo n.º 3
0
 public function testCanGenerateUniquePasswordWithSymbols()
 {
     $generator = new Generator();
     $generator->setNumberOfSymbols(5);
     $password = $generator->generate();
     assertInternalType('string', $password);
     assertEquals(8, strlen($password));
     assertEquals(5, $this->helper->countSymbols($password));
     assertEquals(3, $this->helper->countLowerCaseLetters($password));
     assertNotEquals($password, $generator->generate());
 }
Ejemplo n.º 4
0
 /**
  * @covers Mobileka\ScopeApplicator\Configurator::setType
  * @expectedException PHPUnit_Framework_Error_Warning
  * @test
  */
 public function sets_variable_type()
 {
     $configurator = $this->getInstance();
     foreach (['bool', 'string', 'int', 'array', 'null'] as $type) {
         foreach ([1, true, 'somestring', null] as $variable) {
             $result = $this->invokeMethod($configurator, 'setType', [$variable, $type]);
             assertInternalType($type, $result, "Impossible to convert {$variable} to {$type} type");
         }
     }
     // should issue a warning
     $this->invokeMethod($configurator, 'setType', [1, 'unknown_type']);
 }
Ejemplo n.º 5
0
 public function test_it_can_get_unregistered_templates_list()
 {
     $results = $this->TemplatesRepository->unregisteredTemplatesList();
     assertInternalType('array', $results);
     assertEquals('app', $results['app']);
 }
Ejemplo n.º 6
0
 /** @test */
 public function it_gets_an_array_only_of_attributes()
 {
     $attributes = TestDummy::attributesFor('Post', ['title' => 'override']);
     assertInternalType('array', $attributes);
     assertEquals('override', $attributes['title']);
 }
Ejemplo n.º 7
0
 public function test_it_can_destroy_permission()
 {
     $result = $this->PermissionsManager->destroyPermission('isDeveloper');
     assertInternalType('array', $result);
 }
Ejemplo n.º 8
0
 public function test_it_cannot_destroy_user()
 {
     $output = $this->UserManager->destroyUser(1);
     assertInternalType('boolean', $output);
 }
Ejemplo n.º 9
0
 public function test_it_can_evaluate_results()
 {
     $conditionName = 'isDeveloper';
     $conditionObject = $this->RuleManager->getCondition($conditionName);
     $results = $this->RuleManager->executeCondition($conditionObject);
     assertInternalType('boolean', $this->RuleManager->evaluateResults($results, false, $conditionObject));
     assertEquals(false, $this->RuleManager->evaluateResults($results, false, $conditionObject));
 }
Ejemplo n.º 10
0
 public function test_it_has_update_rules()
 {
     assertInternalType('array', $this->MenusManager->updateRules(1));
 }
Ejemplo n.º 11
0
 public function testToArrayWithName()
 {
     $this->person->firstName = 'Tyler';
     $array = $this->hydrator->toArray($this->person, $this->metadata);
     assertArrayHasKey('first_name', $array);
     assertInternalType('string', $array['first_name']);
     assertEquals('Tyler', $array['first_name']);
 }