Skip to content

Commit

Permalink
Adjust before handler to facilitate #130
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Mar 12, 2017
1 parent 272f575 commit e05752c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/tests.php
Expand Up @@ -34,7 +34,7 @@ private function action($method,$url,$data='')
'tenancy_function'=>function($action,$database,$table,$column) { return ($table=='users'&&$column=='id')?1:null; },
'input_sanitizer'=>function($action,$database,$table,$column,$type,$value) { return is_string($value)?strip_tags($value):$value; },
'input_validator'=>function($action,$database,$table,$column,$type,$value,$context) { return ($column=='category_id' && !is_numeric($value))?'must be numeric':true; },
'before' => function ($action,$database,$table,$id,$inputs) { if ($action=='create') foreach ($inputs as $input) if ($input) $input->created_at = date('Y-m-d H:i:s',1386752948); },
'before' => function (&$action,&$database,&$table,&$id,&$inputs) { if ($action=='create') foreach ($inputs as $input) if ($input) $input->created_at = date('Y-m-d H:i:s',1386752948); },
'after' => function ($action,$database,$table,$id,$inputs,$output) { file_put_contents('log.txt',var_export(array($action,$database,$table,$id,$inputs,$output),true),FILE_APPEND); },
// for tests
'method' =>$method,
Expand Down

0 comments on commit e05752c

Please sign in to comment.