LD 5 anni fa
parent
commit
2f548a66e8

+ 1 - 1
app/Console/Commands/MakeTestCommand.php

@@ -72,7 +72,7 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
     }
     protected function getModelNamePlural()
     {
-        $modelName=preg_replace('/(s|x|ch|sh)$/','ses',lcfirst($this->getModelName()));
+        $modelName=preg_replace('/(s|x|ch|sh)$/','$1es',lcfirst($this->getModelName()));
         $modelName=preg_replace('/y$/','ies',$modelName);
         $modelName=preg_replace('/[cC]hild$/','children',$modelName);
         if(preg_match('/[cC]hildren$/',$modelName)==0){

+ 3 - 2
tests/Services/BatchService/AssignTasksTest.php

@@ -17,20 +17,21 @@ class AssignTasksTest extends TestCase
     {
         parent::setUp();
         $this->service = app('BatchService');
-        $this->data['Batses']
+        $this->data['Batches']
             = factory(Batch::class, $this->amount)
             ->create();
     }
 
     public function testReturned()
     {
+        $this->service->assignTasks($this->data['Batches']);
         $this->assertTrue(true);
     }
 
     function tearDown(): void
     {
         Batch::query()
-            ->whereIn('id',data_get($this->data['Batses'],'*.id')??[])
+            ->whereIn('id',data_get($this->data['Batches'],'*.id')??[])
             ->delete();
         parent::tearDown();
     }