Skip to content

Commit 36c1f18

Browse files
authored
Added months() to Wormhole (#36808)
1 parent 2a73861 commit 36c1f18

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Illuminate/Foundation/Testing/Wormhole.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ public function weeks($callback = null)
102102
return $this->handleCallback($callback);
103103
}
104104

105+
/**
106+
* Travel forward the given number of months.
107+
*
108+
* @param callable|null $callback
109+
* @return mixed
110+
*/
111+
public function months($callback = null)
112+
{
113+
Carbon::setTestNow(Carbon::now()->addMonths($this->value));
114+
115+
return $this->handleCallback($callback);
116+
}
117+
105118
/**
106119
* Travel forward the given number of years.
107120
*

0 commit comments

Comments
 (0)