File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php namespace Reshadman \EloquentFaster \Tests ;
2+
3+ use Reshadman \EloquentFaster \FasterModel ;
4+
5+ class FasterModelTest extends \PHPUnit_Framework_TestCase {
6+
7+ public function test_get_cached_attributes_method ()
8+ {
9+ FasterModel::cacheMutatedAttributes (User::class);
10+
11+ $ this ->assertTrue (isset (FasterModel::getCachedMutatorAttributes ()[User::class]));
12+
13+ $ this ->assertContains ('url ' , FasterModel::getCachedMutatorAttributes ()[User::class]);
14+ }
15+
16+ public function test_load_array_from_cache ()
17+ {
18+ $ array = [
19+ User::class => [
20+ 'url '
21+ ]
22+ ];
23+
24+ FasterModel::loadArrayIntoCachedMutatorAttributes ($ array );
25+
26+ $ this ->assertEquals (FasterModel::getCachedMutatorAttributes (), $ array );
27+ }
28+
29+ }
30+
31+
32+ class User extends FasterModel {
33+
34+ public function getUrlAttribute ()
35+ {
36+
37+ }
38+
39+ }
You can’t perform that action at this time.
0 commit comments