File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,12 +39,24 @@ protected function setUp(): void
3939 self ::$ folderSupportResult = self ::$ folderSupport . 'result/ ' ;
4040 }
4141
42+ #[DataProvider('provideEncryptor ' )]
43+ public static function testEncryptor (string $ checkFiles = '' , string $ expectedFiles = '' ): void
44+ {
45+ (new Secure ())->setFile (self ::$ folderSupport . $ checkFiles )->setPassword ('111 ' )->output (self ::$ folderSupportResult . $ expectedFiles );
46+
47+ self ::assertFileExists (self ::$ folderSupportResult . $ expectedFiles );
48+
49+ if (is_file (self ::$ folderSupportResult . $ expectedFiles )) {
50+ unlink (self ::$ folderSupportResult . $ expectedFiles );
51+ }
52+ }
53+
4254 /**
4355 * Provider Excel
4456 *
4557 * @return Generator<string, array<string, string>>
4658 */
47- public static function provideExcel ()
59+ public static function provideEncryptor (): iterable
4860 {
4961 $ PHPID = PHP_VERSION_ID ;
5062
@@ -84,18 +96,6 @@ public static function provideExcel()
8496 ];
8597 }
8698
87- #[DataProvider('provideExcel ' )]
88- public static function testEncryptor (string $ checkFiles = '' , string $ expectedFiles = '' ): void
89- {
90- (new Secure ())->setFile (self ::$ folderSupport . $ checkFiles )->setPassword ('111 ' )->output (self ::$ folderSupportResult . $ expectedFiles );
91-
92- self ::assertFileExists (self ::$ folderSupportResult . $ expectedFiles );
93-
94- if (is_file (self ::$ folderSupportResult . $ expectedFiles )) {
95- unlink (self ::$ folderSupportResult . $ expectedFiles );
96- }
97- }
98-
9999 public static function testEncryptorWithBinaryData (): void
100100 {
101101 $ data = self ::$ folderSupport . 'Book1.xlsx ' ;
You can’t perform that action at this time.
0 commit comments