tweaked automigrate to check for git status and extracted the base flags from the plugins
This commit is contained in:
+6
-6
@@ -18,7 +18,13 @@ type TestApp struct {
|
||||
|
||||
// EventCalls defines a map to inspect which app events
|
||||
// (and how many times) were triggered.
|
||||
//
|
||||
// The following events are not counted because they execute always:
|
||||
// - OnBeforeBootstrap
|
||||
// - OnAfterBootstrap
|
||||
// - OnBeforeServe
|
||||
EventCalls map[string]int
|
||||
|
||||
TestMailer *TestMailer
|
||||
}
|
||||
|
||||
@@ -81,12 +87,6 @@ func NewTestApp(optTestDataDir ...string) (*TestApp, error) {
|
||||
TestMailer: &TestMailer{},
|
||||
}
|
||||
|
||||
// no need to count since this is executed always
|
||||
// t.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
// t.EventCalls["OnBeforeServe"]++
|
||||
// return nil
|
||||
// })
|
||||
|
||||
t.OnModelBeforeCreate().Add(func(e *core.ModelEvent) error {
|
||||
t.EventCalls["OnModelBeforeCreate"]++
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user