@@ -260,12 +260,12 @@ public function testDotenvAssertions()
260
260
$ dotenv ->load ();
261
261
$ this ->assertSame ('val1 ' , getenv ('ASSERTVAR1 ' ));
262
262
$ this ->assertEmpty (getenv ('ASSERTVAR2 ' ));
263
- $ this ->assertEmpty ( getenv ('ASSERTVAR3 ' ));
263
+ $ this ->assertSame ( ' val3 ' , getenv ('ASSERTVAR3 ' ));
264
264
$ this ->assertSame ('0 ' , getenv ('ASSERTVAR4 ' ));
265
265
$ this ->assertSame ('#foo ' , getenv ('ASSERTVAR5 ' ));
266
266
$ this ->assertSame ("val1 \nval2 " , getenv ('ASSERTVAR6 ' ));
267
- $ this ->assertSame ("val3 " , getenv ('ASSERTVAR7 ' ));
268
- $ this ->assertSame ("val3 " , getenv ('ASSERTVAR8 ' ));
267
+ $ this ->assertSame ("\n val3 " , getenv ('ASSERTVAR7 ' ));
268
+ $ this ->assertSame ("val3 \n " , getenv ('ASSERTVAR8 ' ));
269
269
270
270
$ dotenv ->required ([
271
271
'ASSERTVAR1 ' ,
@@ -281,6 +281,7 @@ public function testDotenvAssertions()
281
281
282
282
$ dotenv ->required ([
283
283
'ASSERTVAR1 ' ,
284
+ 'ASSERTVAR3 ' ,
284
285
'ASSERTVAR4 ' ,
285
286
'ASSERTVAR5 ' ,
286
287
'ASSERTVAR6 ' ,
@@ -292,9 +293,7 @@ public function testDotenvAssertions()
292
293
'ASSERTVAR1 ' ,
293
294
'ASSERTVAR4 ' ,
294
295
'ASSERTVAR5 ' ,
295
- 'ASSERTVAR7 ' ,
296
- 'ASSERTVAR8 ' ,
297
- ])->notEmpty ()->allowedValues (['0 ' , 'val1 ' , 'val3 ' , '#foo ' ]);
296
+ ])->notEmpty ()->allowedValues (['0 ' , 'val1 ' , '#foo ' ]);
298
297
299
298
$ this ->assertTrue (true ); // anything wrong an an exception will be thrown
300
299
}
@@ -314,26 +313,13 @@ public function testDotenvEmptyThrowsRuntimeException()
314
313
315
314
/**
316
315
* @expectedException \Dotenv\Exception\ValidationException
317
- * @expectedExceptionMessage One or more environment variables failed assertions: ASSERTVAR3 is empty.
316
+ * @expectedExceptionMessage One or more environment variables failed assertions: ASSERTVAR9 is empty.
318
317
*/
319
318
public function testDotenvStringOfSpacesConsideredEmpty ()
320
319
{
321
320
$ dotenv = Dotenv::create ($ this ->fixturesFolder , 'assertions.env ' );
322
321
$ dotenv ->load ();
323
- $ this ->assertEmpty (getenv ('ASSERTVAR3 ' ));
324
-
325
- $ dotenv ->required ('ASSERTVAR3 ' )->notEmpty ();
326
- }
327
-
328
- /**
329
- * @expectedException \Dotenv\Exception\ValidationException
330
- * @expectedExceptionMessage One or more environment variables failed assertions: ASSERTVAR3 is empty.
331
- */
332
- public function testDotenvHitsLastChain ()
333
- {
334
- $ dotenv = Dotenv::create ($ this ->fixturesFolder , 'assertions.env ' );
335
- $ dotenv ->load ();
336
- $ dotenv ->required ('ASSERTVAR3 ' )->notEmpty ();
322
+ $ dotenv ->required ('ASSERTVAR9 ' )->notEmpty ();
337
323
}
338
324
339
325
/**
0 commit comments