Skip to content

Commit

Permalink
corrige testes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelchavesfreitas committed Jul 24, 2019
1 parent 4696c85 commit c40e690
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/MetadataTest.php
Expand Up @@ -71,7 +71,7 @@ function testValidations(){

foreach($metas as $meta_key => $config){
$definition = new MapasCulturais\Definitions\Metadata($meta_key, $config);
$app->unregisterEntityMetadata('MapasCulturais\Entities\Agent');
$app->unregisterEntityMetadata('MapasCulturais\Entities\Agent', $meta_key);
$app->registerMetadata($definition, 'MapasCulturais\Entities\Agent', $type->id);

$agent = new Agent;
Expand Down
5 changes: 3 additions & 2 deletions tests/classes/TestCase.php
Expand Up @@ -52,12 +52,13 @@ public function __set($name, $value) {
* @return \MapasCulturais\Entity
*/
function getNewEntity($class, $user = null, $owner = null){
$app = $this->app;

if(!is_null($user)){
$_user = $this->app->user->is('guest') ? null : $this->app->user;
$_user = $app->user->is('guest') ? null : $app->user;
$this->user = $user;
}

$app = App::i();
$classname = 'MapasCulturais\Entities\\' . $class;

$_types = $app->getRegisteredEntityTypes($classname);
Expand Down

0 comments on commit c40e690

Please sign in to comment.