Skip to content

Commit e05752c

Browse files
committed
Adjust before handler to facilitate #130
1 parent 272f575 commit e05752c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/tests.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private function action($method,$url,$data='')
3434
'tenancy_function'=>function($action,$database,$table,$column) { return ($table=='users'&&$column=='id')?1:null; },
3535
'input_sanitizer'=>function($action,$database,$table,$column,$type,$value) { return is_string($value)?strip_tags($value):$value; },
3636
'input_validator'=>function($action,$database,$table,$column,$type,$value,$context) { return ($column=='category_id' && !is_numeric($value))?'must be numeric':true; },
37-
'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); },
37+
'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); },
3838
'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); },
3939
// for tests
4040
'method' =>$method,

0 commit comments

Comments
 (0)