|
@@ 315-328 (lines=14) @@
|
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
/** @test */ |
| 315 |
|
public function it_can_add_autoload_paths() |
| 316 |
|
{ |
| 317 |
|
$form = $this->form(); |
| 318 |
|
$form->addPath(__DIR__.'/folder'); |
| 319 |
|
$form->addPath(__DIR__.'/folder/subfolder'); |
| 320 |
|
|
| 321 |
|
$paths = $form->paths(); |
| 322 |
|
|
| 323 |
|
$this->assertCount(4, $paths); |
| 324 |
|
$this->assertContains('forms/tests/unit/folder/subfolder', $paths[0]); |
| 325 |
|
$this->assertContains('forms/tests/unit/folder/', $paths[1]); |
| 326 |
|
$this->assertContains('forms/tests/unit/stubs/', $paths[2]); |
| 327 |
|
$this->assertContains('forms/src/', $paths[3]); |
| 328 |
|
} |
| 329 |
|
|
| 330 |
|
/** @test */ |
| 331 |
|
public function it_will_not_add_autoload_paths_that_do_not_exist() |
|
@@ 331-345 (lines=15) @@
|
| 328 |
|
} |
| 329 |
|
|
| 330 |
|
/** @test */ |
| 331 |
|
public function it_will_not_add_autoload_paths_that_do_not_exist() |
| 332 |
|
{ |
| 333 |
|
$form = $this->form(); |
| 334 |
|
$form->addPath(__DIR__.'/folder'); |
| 335 |
|
$form->addPath(__DIR__.'/folder/subfolder'); |
| 336 |
|
$form->addPath(__DIR__.'/folder/doesnotexist'); |
| 337 |
|
|
| 338 |
|
$paths = $form->paths(); |
| 339 |
|
|
| 340 |
|
$this->assertCount(4, $paths); |
| 341 |
|
$this->assertContains('forms/tests/unit/folder/subfolder', $paths[0]); |
| 342 |
|
$this->assertContains('forms/tests/unit/folder/', $paths[1]); |
| 343 |
|
$this->assertContains('forms/tests/unit/stubs/', $paths[2]); |
| 344 |
|
$this->assertContains('forms/src/', $paths[3]); |
| 345 |
|
} |
| 346 |
|
|
| 347 |
|
/** @test */ |
| 348 |
|
public function it_adds_autoload_paths_with_trailing_slash() |
|
@@ 348-360 (lines=13) @@
|
| 345 |
|
} |
| 346 |
|
|
| 347 |
|
/** @test */ |
| 348 |
|
public function it_adds_autoload_paths_with_trailing_slash() |
| 349 |
|
{ |
| 350 |
|
$form = $this->form(); |
| 351 |
|
$form->addPath(__DIR__.'/folder/'); |
| 352 |
|
$form->addPath(__DIR__.'/folder/subfolder/'); |
| 353 |
|
|
| 354 |
|
$paths = $form->paths(); |
| 355 |
|
|
| 356 |
|
$this->assertContains('forms/tests/unit/folder/subfolder', $paths[0]); |
| 357 |
|
$this->assertContains('forms/tests/unit/folder/', $paths[1]); |
| 358 |
|
$this->assertContains('forms/tests/unit/stubs/', $paths[2]); |
| 359 |
|
$this->assertContains('forms/src/', $paths[3]); |
| 360 |
|
} |
| 361 |
|
|
| 362 |
|
/** @test */ |
| 363 |
|
public function it_can_set_template() |