mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 23:27:17 +08:00
feat: remove tests
This commit is contained in:
@@ -3,10 +3,7 @@ package services
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/goravel/framework/testing/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"panel/app/models"
|
||||
)
|
||||
|
||||
type SettingTestSuite struct {
|
||||
@@ -25,20 +22,20 @@ func (s *SettingTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
func (s *SettingTestSuite) TestGet() {
|
||||
mockOrm, mockDb, _, _ := mock.Orm()
|
||||
/*mockOrm, mockDb, _, _ := mock.Orm()
|
||||
mockOrm.On("Query").Return(mockDb).Twice()
|
||||
mockDb.On("Where", "key", "test").Return(mockDb).Twice()
|
||||
mockDb.On("FirstOrFail", &models.Setting{}).Return(nil).Twice()
|
||||
a := s.setting.Get("test")
|
||||
b := s.setting.Get("test", "test")
|
||||
s.Equal("", a)
|
||||
s.Equal("test", b)
|
||||
s.Equal("test", b)*/
|
||||
}
|
||||
|
||||
func (s *SettingTestSuite) TestSet() {
|
||||
mockOrm, mockDb, _, _ := mock.Orm()
|
||||
/*mockOrm, mockDb, _, _ := mock.Orm()
|
||||
mockOrm.On("Query").Return(mockDb).Once()
|
||||
mockDb.On("UpdateOrCreate", &models.Setting{}, models.Setting{Key: "test"}, models.Setting{Value: "test"}).Return(nil).Once()
|
||||
err := s.setting.Set("test", "test")
|
||||
s.Nil(err)
|
||||
s.Nil(err)*/
|
||||
}
|
||||
|
||||
@@ -4,10 +4,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/goravel/framework/testing/mock"
|
||||
|
||||
"panel/app/models"
|
||||
)
|
||||
|
||||
type UserTestSuite struct {
|
||||
@@ -26,7 +22,7 @@ func (s *UserTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
func (s *UserTestSuite) TestCreate() {
|
||||
mockOrm, mockDb, _, _ := mock.Orm()
|
||||
/*mockOrm, mockDb, _, _ := mock.Orm()
|
||||
mockOrm.On("Query").Return(mockDb).Once()
|
||||
mockDb.On("Create", &models.User{
|
||||
Username: "haozi",
|
||||
@@ -34,5 +30,5 @@ func (s *UserTestSuite) TestCreate() {
|
||||
}).Return(nil).Once()
|
||||
user, err := s.user.Create("haozi", "123456")
|
||||
s.Nil(err)
|
||||
s.Equal("haozi", user.Username)
|
||||
s.Equal("haozi", user.Username)*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user