Fixing Tests
Signed-off-by: Adam Engebretson <adam.engebretson@bridgeconx.com>
This commit is contained in:
1 parent
68f2a68c47
commit
3e6729614c
1 file changed
+7
-5
@@ -20,11 +20,13 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
|||||||
Capsule::table('models')->truncate();
|
Capsule::table('models')->truncate();
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
|
||||||
|
$this->now = Carbon::now();
|
||||||
|
|
||||||
$this->modelData = [
|
$this->modelData = [
|
||||||
'string' => 'abcdefghijklmnop',
|
'string' => 'abcdefghijklmnop',
|
||||||
'email' => 'tj@tjshafer.com',
|
'email' => 'tj@tjshafer.com',
|
||||||
'created_at' => Carbon::now(),
|
'created_at' => $this->now,
|
||||||
'updated_at' => Carbon::now(),
|
'updated_at' => $this->now,
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));
|
$this->urlGenerator = new UrlGenerator(new RouteCollection(), Request::create('/foo', 'GET'));
|
||||||
@@ -39,7 +41,7 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->formBuilder->setModel($model);
|
$this->formBuilder->setModel($model);
|
||||||
|
|
||||||
$this->assertEquals($model->getFormValue('string'), 'ponmlkjihgfedcba');
|
$this->assertEquals($model->getFormValue('string'), 'ponmlkjihgfedcba');
|
||||||
$this->assertEquals($model->getFormValue('created_at'), time());
|
$this->assertEquals($model->getFormValue('created_at'), $this->now->timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItCanStillMutateValuesForViews()
|
public function testItCanStillMutateValuesForViews()
|
||||||
@@ -48,7 +50,7 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->formBuilder->setModel($model);
|
$this->formBuilder->setModel($model);
|
||||||
|
|
||||||
$this->assertEquals($model->string, 'ABCDEFGHIJKLMNOP');
|
$this->assertEquals($model->string, 'ABCDEFGHIJKLMNOP');
|
||||||
$this->assertEquals($model->created_at, Carbon::now()->diffForHumans());
|
$this->assertEquals($model->created_at, '1 second ago');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItDoesntRequireTheUseOfThisFeature()
|
public function testItDoesntRequireTheUseOfThisFeature()
|
||||||
@@ -57,7 +59,7 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->formBuilder->setModel($model);
|
$this->formBuilder->setModel($model);
|
||||||
|
|
||||||
$this->assertEquals($model->string, 'ABCDEFGHIJKLMNOP');
|
$this->assertEquals($model->string, 'ABCDEFGHIJKLMNOP');
|
||||||
$this->assertEquals($model->created_at, Carbon::now()->diffForHumans());
|
$this->assertEquals($model->created_at, '1 second ago');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user