File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 11composer.lock
22vendor
3+ .phpunit.result.cache
Original file line number Diff line number Diff line change 66 "Statamic\\ Eloquent\\ " : " src"
77 }
88 },
9+ "autoload-dev" : {
10+ "psr-4" : {
11+ "Tests\\ " : " tests"
12+ }
13+ },
914 "extra" : {
1015 "statamic" : {
1116 "name" : " Eloquent Driver" ,
1924 },
2025 "require" : {
2126 "statamic/cms" : " ^3.0"
27+ },
28+ "require-dev" : {
29+ "phpunit/phpunit" : " ^9.4"
2230 }
2331}
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit backupGlobals =" false"
3+ backupStaticAttributes =" false"
4+ bootstrap =" vendor/autoload.php"
5+ colors =" true"
6+ convertErrorsToExceptions =" true"
7+ convertNoticesToExceptions =" true"
8+ convertWarningsToExceptions =" true"
9+ processIsolation =" false"
10+ stopOnFailure =" false" >
11+ <testsuites >
12+ <testsuite name =" Tests" >
13+ <directory suffix =" Test.php" >./tests</directory >
14+ </testsuite >
15+ </testsuites >
16+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Entries ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+ use Statamic \Eloquent \Entries \EntryModel ;
7+
8+ class EntryModelTest extends TestCase
9+ {
10+ /** @test */
11+ public function it_gets_attributes_from_json_column ()
12+ {
13+ $ model = new EntryModel ([
14+ 'slug ' => 'the-slug ' ,
15+ 'data ' => [
16+ 'foo ' => 'bar '
17+ ]
18+ ]);
19+
20+ $ this ->assertEquals ('the-slug ' , $ model ->slug );
21+ $ this ->assertEquals ('bar ' , $ model ->foo );
22+ $ this ->assertEquals (['foo ' => 'bar ' ], $ model ->data );
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments