33namespace Tests ;
44
55use Illuminate \Support \Carbon ;
6- use Illuminate \Support \Facades \Config ;
76use Overtrue \LaravelVersionable \Diff ;
87use Overtrue \LaravelVersionable \Version ;
98use Overtrue \LaravelVersionable \VersionStrategy ;
@@ -398,10 +397,8 @@ public function relations_will_not_in_version_contents()
398397 /**
399398 * @test
400399 */
401- public function it_creates_initial_version_when_enabled ()
400+ public function it_creates_initial_version ()
402401 {
403- Config::set ('versionable.keep_original_version ' , true );
404-
405402 $ post = new Post ;
406403
407404 Post::withoutVersion (function () use (&$ post ) {
@@ -418,25 +415,4 @@ public function it_creates_initial_version_when_enabled()
418415 $ this ->assertSame ('version1 ' , $ post ->firstVersion ->contents ['title ' ]);
419416 $ this ->assertSame ('version2 ' , $ post ->lastVersion ->contents ['title ' ]);
420417 }
421-
422- /**
423- * @test
424- */
425- public function it_doesnt_create_initial_version_when_disabled ()
426- {
427- $ post = new Post ;
428-
429- Post::withoutVersion (function () use (&$ post ) {
430- $ post = Post::create (['title ' => 'version1 ' , 'content ' => 'version1 content ' ]);
431- });
432-
433- $ this ->assertCount (0 , $ post ->versions );
434-
435- $ post ->update (['title ' => 'version2 ' ]);
436-
437- $ post ->refresh ();
438-
439- $ this ->assertCount (1 , $ post ->versions );
440- $ this ->assertNotSame ('version1 ' , $ post ->firstVersion ->contents ['title ' ]);
441- }
442418}
0 commit comments