(suiteName, testName string)
| 36 | } |
| 37 | |
| 38 | func (s *PluginSuite) BeforeTest(suiteName, testName string) { |
| 39 | mode.Set(mode.TestDev) |
| 40 | s.db = testdb.NewDB(s.T()) |
| 41 | s.resetRecorder() |
| 42 | manager, err := plugin.NewManager(s.db, "", nil, s) |
| 43 | assert.Nil(s.T(), err) |
| 44 | s.manager = manager |
| 45 | withURL(s.ctx, "http", "example.com") |
| 46 | s.a = &PluginAPI{DB: s.db, Manager: manager, Notifier: s} |
| 47 | |
| 48 | mockPluginCompat := new(mock.Plugin) |
| 49 | assert.Nil(s.T(), s.manager.LoadPlugin(mockPluginCompat)) |
| 50 | |
| 51 | s.db.User(1) |
| 52 | assert.Nil(s.T(), s.manager.InitializeForUserID(1)) |
| 53 | s.db.User(2) |
| 54 | assert.Nil(s.T(), s.manager.InitializeForUserID(2)) |
| 55 | |
| 56 | s.db.CreatePluginConf(&model.PluginConf{ |
| 57 | UserID: 1, |
| 58 | ModulePath: "github.com/gotify/server/v2/plugin/example/removed", |
| 59 | Token: "P1234", |
| 60 | Enabled: false, |
| 61 | }) |
| 62 | } |
| 63 | |
| 64 | func (s *PluginSuite) getDanglingConf(uid uint) *model.PluginConf { |
| 65 | conf, err := s.db.GetPluginConfByUserAndPath(uid, "github.com/gotify/server/v2/plugin/example/removed") |
nothing calls this directly
no test coverage detected