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']); }
/** * @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); }
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()); }
/** * @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']); }
public function test_it_can_get_unregistered_templates_list() { $results = $this->TemplatesRepository->unregisteredTemplatesList(); assertInternalType('array', $results); assertEquals('app', $results['app']); }
/** @test */ public function it_gets_an_array_only_of_attributes() { $attributes = TestDummy::attributesFor('Post', ['title' => 'override']); assertInternalType('array', $attributes); assertEquals('override', $attributes['title']); }
public function test_it_can_destroy_permission() { $result = $this->PermissionsManager->destroyPermission('isDeveloper'); assertInternalType('array', $result); }
public function test_it_cannot_destroy_user() { $output = $this->UserManager->destroyUser(1); assertInternalType('boolean', $output); }
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)); }
public function test_it_has_update_rules() { assertInternalType('array', $this->MenusManager->updateRules(1)); }
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']); }