Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jan 23, 2024
1 parent dcb3358 commit b61c633
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/database/test/Platform/PostgreSQLPlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function testGetViews(): void
ww_articles.language,
ww_articles.params
FROM ww_articles;'
)
)
),
'CHECK_OPTION' => 'NONE',
'IS_UPDATABLE' => 'YES',
Expand Down
1 change: 0 additions & 1 deletion packages/filter/src/Rule/Clamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Windwalker\Filter\Rule;

use Windwalker\Filter\AbstractFilter;

use Windwalker\Utilities\TypeCast;

use function Windwalker\clamp;
Expand Down
4 changes: 0 additions & 4 deletions packages/form/src/Field/AbstractField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use BadMethodCallException;
use Closure;
use InvalidArgumentException;
use Windwalker\Data\Collection;
use Windwalker\DOM\DOMElement;
use Windwalker\Form\Field\Concern\{ManageFilterTrait,
ManageInputTrait,
Expand All @@ -23,9 +22,6 @@
use Windwalker\Utilities\Options\StateAccessTrait;
use Windwalker\Utilities\Str;

use Windwalker\Utilities\TypeCast;

use function Windwalker\collect;
use function Windwalker\DOM\h;

/**
Expand Down
1 change: 0 additions & 1 deletion packages/form/src/Field/TextField.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Windwalker\DOM\DOMElement;
use Windwalker\Filter\Rule\Length;
use Windwalker\Form\Field\Concern\ListOptionsTrait;

use Windwalker\Utilities\TypeCast;

use function Windwalker\DOM\h;
Expand Down
2 changes: 1 addition & 1 deletion packages/http/src/CaBundleFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function find(): ?string

$finder = static::getFinder();

$file =$finder();
$file = $finder();

if (file_exists($file)) {
return $file;
Expand Down
2 changes: 0 additions & 2 deletions packages/http/test/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
use Windwalker\Http\Test\Mock\MockTransport;
use Windwalker\Http\Transport\CurlTransport;
use Windwalker\Promise\Promise;
use Windwalker\Promise\Scheduler\TaskQueue;
use Windwalker\Test\Traits\BaseAssertionTrait;
use Windwalker\Uri\Uri;
use Windwalker\Uri\UriHelper;

use Windwalker\Utilities\Str;

use function Windwalker\Uri\uri_prepare;
Expand Down
9 changes: 4 additions & 5 deletions packages/orm/src/EntityMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,11 @@ public function deleteWhere(mixed $conditions, int $options = 0): void
} else {
// If Entity has keys, use this keys to delete once per item.
$delItems = (function () use ($metadata, $conditions) {
while (
$item = $this->getORM()
$query = $this->getORM()
->from($metadata->getClassName())
->where($this->conditionsToWheres($conditions))
->get($metadata->getClassName())
) {
->where($this->conditionsToWheres($conditions));

while ($item = $query->get($metadata->getClassName())) {
yield $item;
}
})();
Expand Down
2 changes: 1 addition & 1 deletion packages/promise/src/Scheduler/ScheduleCursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ScheduleCursor
/**
* @var mixed
*/
readonly protected mixed $cursor;
protected readonly mixed $cursor;

protected bool $scheduled = false;

Expand Down
36 changes: 18 additions & 18 deletions packages/query/test/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,24 +468,24 @@ function (Query $query) {
public function testUnion(): void
{
// Select and union
$q = self::createQuery()
->select('*')
->from('foo')
->where('id', '>', 12)
->group('user_id');

$q->union(
self::createQuery()
->select('*')
->from('bar')
->where('id', '<', 50)
->alias('bar')
);

self::assertSqlEquals(
'SELECT * FROM "foo" WHERE "id" > 12 GROUP BY "user_id" UNION (SELECT * FROM "bar" WHERE "id" < 50)',
$q->render(true)
);
// $q = self::createQuery()
// ->select('*')
// ->from('foo')
// ->where('id', '>', 12)
// ->group('user_id');
//
// $q->union(
// self::createQuery()
// ->select('*')
// ->from('bar')
// ->where('id', '<', 50)
// ->alias('bar')
// );
//
// self::assertSqlEquals(
// 'SELECT * FROM "foo" WHERE "id" > 12 GROUP BY "user_id" UNION (SELECT * FROM "bar" WHERE "id" < 50)',
// $q->render(true)
// );

// Union wrap every select
$q = self::createQuery();
Expand Down
1 change: 0 additions & 1 deletion packages/reactor/src/Memory/MemoryTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Windwalker\Reactor\Memory;

use Windwalker\Reactor\Swoole\Room\DuoMapping;

use Windwalker\Reactor\Swoole\Room\RoomMapping;
use Windwalker\Reactor\Swoole\Room\UserFdMapping;

Expand Down
2 changes: 1 addition & 1 deletion packages/uri/test/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function testAuthority($url, $expected)
self::assertEquals($expected, $uri->getAuthority());
}

public function queryStringsForEncoding(): array
public static function queryStringsForEncoding(): array
{
return [
'key-only' => ['k^ey', 'k%5Eey'],
Expand Down

0 comments on commit b61c633

Please sign in to comment.