1111use PHPUnit \Framework \TestCase ;
1212use MichaelDrennen \LocalFile \LocalFile ;
1313
14- class SplitTest extends TestCase
15- {
14+ class SplitTest extends TestCase {
1615
1716 const VFS_ROOT_DIR = 'vfsRootDir ' ;
1817 const WRITEABLE_DIR_NAME = 'writeableDir ' ;
@@ -57,9 +56,8 @@ class SplitTest extends TestCase
5756 /**
5857 * Set up test environment
5958 */
60- public function setUp ()
61- {
62- self ::$ vfsRootDirObject = vfsStream::setup (self ::VFS_ROOT_DIR );
59+ public function setUp (): void {
60+ self ::$ vfsRootDirObject = vfsStream::setup (self ::VFS_ROOT_DIR );
6361 self ::$ writeableDirectory = vfsStream::url (self ::VFS_ROOT_DIR . DIRECTORY_SEPARATOR . self ::WRITEABLE_DIR_NAME );
6462 mkdir (self ::$ writeableDirectory , 0777 );
6563 self ::$ anotherWriteableDirectory = vfsStream::url (self ::VFS_ROOT_DIR . DIRECTORY_SEPARATOR . self ::ANOTHER_WRITEABLE_DIR_NAME );
@@ -76,29 +74,25 @@ public function setUp()
7674 }
7775
7876
79- public function testSplitWithNonExistentFileShouldThrowException ()
80- {
77+ public function testSplitWithNonExistentFileShouldThrowException () {
8178 $ this ->expectException (SourceFileDoesNotExist::class);
8279 LocalFile::split (self ::PATH_TO_NON_EXISTENT_FILE );
8380 }
8481
85- public function testSplitWithUnreadableFileShouldThrowException ()
86- {
82+ public function testSplitWithUnreadableFileShouldThrowException () {
8783 $ this ->expectException (UnableToReadFile::class);
8884 LocalFile::split (self ::$ unreadableSourceFilePath );
8985 }
9086
91- public function testSplitIntoReadOnlyDirectoryShouldThrowException ()
92- {
87+ public function testSplitIntoReadOnlyDirectoryShouldThrowException () {
9388 $ this ->expectException (CantWriteToReadOnlyDirectory::class);
9489 LocalFile::split (self ::PATH_TO_SOURCE_FILE , 1 , 'split_ ' , self ::$ readOnlyDirectory );
9590 }
9691
9792 /**
9893 * @group quota
9994 */
100- public function testSplitIntoFullDiskShouldThrowException ()
101- {
95+ public function testSplitIntoFullDiskShouldThrowException () {
10296 $ this ->expectException (UnableToWriteLineToSplitFile::class);
10397 // Gives me enough room to write the source file.
10498 $ bytesInSourceFile = filesize (self ::PATH_TO_SOURCE_FILE );
@@ -114,8 +108,7 @@ public function testSplitIntoFullDiskShouldThrowException()
114108 }
115109
116110
117- public function testSplitShouldMakeFiveFilesInSameDirectory ()
118- {
111+ public function testSplitShouldMakeFiveFilesInSameDirectory () {
119112 LocalFile::split (self ::$ readableSourceFilePath , 4 );
120113 $ files = scandir (self ::$ writeableDirectory );
121114 $ this ->assertCount (9 , $ files ); // includes . and ..
@@ -129,13 +122,12 @@ public function testSplitShouldMakeFiveFilesInSameDirectory()
129122 * @throws \MichaelDrennen\LocalFile\Exceptions\UnableToWriteLineToSplitFile
130123 * @group mike
131124 */
132- public function testSplitShouldMakeFiveFilesInAnotherDirectory ()
133- {
125+ public function testSplitShouldMakeFiveFilesInAnotherDirectory () {
134126 $ expectedFinalFileCount = 5 ;
135- $ linesPerFile = 4 ;
136- $ virtualSourceFilePath = vfsStream::url (self ::VFS_ROOT_DIR . DIRECTORY_SEPARATOR .
137- self ::WRITEABLE_DIR_NAME . DIRECTORY_SEPARATOR .
138- self ::SOURCE_FILE_NAME );
127+ $ linesPerFile = 4 ;
128+ $ virtualSourceFilePath = vfsStream::url (self ::VFS_ROOT_DIR . DIRECTORY_SEPARATOR .
129+ self ::WRITEABLE_DIR_NAME . DIRECTORY_SEPARATOR .
130+ self ::SOURCE_FILE_NAME );
139131 file_put_contents ($ virtualSourceFilePath , file_get_contents (self ::PATH_TO_SOURCE_FILE ));
140132
141133 LocalFile::split ($ virtualSourceFilePath , $ linesPerFile , null , self ::$ anotherWriteableDirectory );
0 commit comments