File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,28 @@ public function it_can_write_a_changelog()
4343 unlink ($ path );
4444 }
4545
46+ /** @test */
47+ public function it_creates_the_directory_recursively_if_it_does_not_exist ()
48+ {
49+ $ adapter = $ this ->adapter ();
50+ $ feature = new Feature ([
51+ new Change ('added ' , 'Added a new feature. ' ),
52+ ]);
53+ $ folderA = __DIR__ .'/../test-data/write-test/nested ' ;
54+ $ folderB = $ folderA .'/second-child ' ;
55+ $ path = $ folderB .'/example.xml ' ;
56+
57+ $ adapter ->write ($ path , $ feature );
58+
59+ $ contents = file_get_contents ($ path );
60+
61+ $ this ->assertStringContainsString ('<change type="added">Added a new feature.</change> ' , $ contents );
62+
63+ unlink ($ path );
64+ rmdir ($ folderB );
65+ rmdir ($ folderA );
66+ }
67+
4668 /** @test */
4769 public function it_throws_an_exception_when_the_file_is_invalid ()
4870 {
You can’t perform that action at this time.
0 commit comments