Skip to content

Commit 337cd3e

Browse files
committed
added tests for the singular method names
1 parent b49b791 commit 337cd3e

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

tests/Eloquent/CallBuilderTest.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,76 @@ public static function provideFunctionNames(): Generator
6060
'toMql',
6161
Builder::class,
6262
];
63+
64+
yield 'average' => [
65+
'average',
66+
Builder::class,
67+
['name'],
68+
];
69+
70+
yield 'avg' => [
71+
'avg',
72+
Builder::class,
73+
['name'],
74+
];
75+
76+
yield 'count' => [
77+
'count',
78+
Builder::class,
79+
['name'],
80+
];
81+
82+
yield 'exists' => [
83+
'exists',
84+
Builder::class,
85+
];
86+
87+
yield 'insert' => [
88+
'insert',
89+
Builder::class,
90+
[['name']],
91+
];
92+
93+
yield 'max' => [
94+
'max',
95+
Builder::class,
96+
['name'],
97+
];
98+
99+
yield 'min' => [
100+
'min',
101+
Builder::class,
102+
['name'],
103+
];
104+
105+
yield 'pluck' => [
106+
'pluck',
107+
Builder::class,
108+
['name'],
109+
];
110+
111+
yield 'pull' => [
112+
'pull',
113+
Builder::class,
114+
['name'],
115+
];
116+
117+
yield 'push' => [
118+
'push',
119+
Builder::class,
120+
['name'],
121+
];
122+
123+
yield 'raw' => [
124+
'raw',
125+
Builder::class,
126+
];
127+
128+
yield 'sum' => [
129+
'sum',
130+
Builder::class,
131+
['name'],
132+
];
63133
}
64134

65135
#[Test]
@@ -97,5 +167,19 @@ public static function provideUnsupportedMethods(): Generator
97167
'This method is not supported by MongoDB. Try "toMql()" instead',
98168
[[['name' => 'Jane']], fn (QueryBuilder $builder) => $builder],
99169
];
170+
171+
yield 'dd' => [
172+
'dd',
173+
BadMethodCallException::class,
174+
'This method is not supported by MongoDB. Try "toMql()" instead',
175+
[[['name' => 'Jane']], fn (QueryBuilder $builder) => $builder],
176+
];
177+
178+
yield 'dump' => [
179+
'dump',
180+
BadMethodCallException::class,
181+
'This method is not supported by MongoDB. Try "toMql()" instead',
182+
[[['name' => 'Jane']], fn (QueryBuilder $builder) => $builder],
183+
];
100184
}
101185
}

0 commit comments

Comments
 (0)