Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Aug 30, 2024
1 parent c7f6d7d commit 5e5b1bb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Core/tests/Attribute/ScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testScope(string|\BackedEnum $name, string $expected): void
public static function scopeNameDataProvider(): \Traversable
{
yield ['foo', 'foo'];
yield [Spiral::HttpRequest, 'http.request'];
yield [Spiral::HttpRequest, 'http-request'];
yield [ScopeEnum::A, 'a'];
}
}
24 changes: 12 additions & 12 deletions src/Core/tests/Scope/ProxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static function (ScopedProxyLoggerCarrier $carrier, LoggerInterface $logger) use
self::assertSame($lc, $carrier);
\Fiber::suspend();
}
}
},
),
static fn() => $root->runScope(
new Scope(
Expand All @@ -73,7 +73,7 @@ static function (ScopedProxyLoggerCarrier $carrier, LoggerInterface $logger) use
self::assertSame($lc, $carrier);
\Fiber::suspend();
}
}
},
),
);
}
Expand All @@ -89,7 +89,7 @@ public function testResolveSameDependencyFromDifferentScopesSingleton(): void
static function (
ScopedProxyLoggerCarrier $carrier,
ScopedProxyLoggerCarrier $carrier2,
LoggerInterface $logger
LoggerInterface $logger,
) {
// from the current `foo` scope
self::assertInstanceOf(KVLogger::class, $logger);
Expand All @@ -100,7 +100,7 @@ static function (
// because of proxy
self::assertSame('kv', $carrier->logger->getName());
self::assertNotSame($carrier2->logger, $carrier->logger, 'Different contexts');
}
},
);
});
}
Expand All @@ -122,7 +122,7 @@ static function (ScopedProxyLoggerCarrier $carrier, LoggerInterface $logger) {

// because of proxy
self::assertSame('kv', $carrier->logger->getName());
}
},
);
});
}
Expand All @@ -139,8 +139,8 @@ public function createInjection(\ReflectionClass $class, mixed $context = null):
{
return new Context($context);
}
}
)
},
),
);

$root->runScope(new Scope(), static function (Container $c1) {
Expand All @@ -160,7 +160,7 @@ public function createInjection(\ReflectionClass $class, mixed $context = null):
self::assertInstanceOf(
ReflectionParameter::class,
$proxy->getContext()->getValue(),
'Context was injected'
'Context was injected',
);
/** @see ScopedProxyStdClass::$context */
self::assertSame('context', $proxy->getContext()->getValue()->getName());
Expand All @@ -180,8 +180,8 @@ public function createInjection(\ReflectionClass $class, mixed $context = null):
{
return new Context($context);
}
}
)
},
),
);

FiberHelper::runFiberSequence(
Expand Down Expand Up @@ -216,7 +216,7 @@ static function (#[Proxy] ContainerInterface $cp) use ($root) {
self::assertInstanceOf(KVLogger::class, $cp->get(LoggerInterface::class));
self::assertSame($cp->get(LoggerInterface::class), $cp->get(LoggerInterface::class));
});
}
},
);
}

Expand Down Expand Up @@ -292,7 +292,7 @@ public function __toString(): string
}
});
self::assertSame('Bar', $proxy->getName());
}
},
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/tests/Scope/UseCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function testHasInParentScopeWithScopeAttribute(): void

public static function scopeEnumDataProvider(): \Traversable
{
yield [Spiral::HttpRequest, 'http.request'];
yield [Spiral::HttpRequest, 'http-request'];
yield [ScopeEnum::A, 'a'];
}
}
2 changes: 1 addition & 1 deletion src/Http/src/Request/InputManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @method mixed attribute(string $name, mixed $default = null)
*/
#[Singleton]
#[Scope('http.request')]
#[Scope('http-request')]
final class InputManager
{
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Router/src/CoreHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function handle(Request $request): Response
*/
$result = $this->scope->runScope(
new Scope(
name: 'http.request',
name: 'http-request',
bindings: [Request::class => $request, Response::class => $response, $controller => $controller],
),
fn (): mixed => $this->tracer->trace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testPaginationProviderInterfaceBindingInRootScope(): void
{
\set_error_handler(static function (int $errno, string $error): void {
self::assertSame(\sprintf(
'Using `%s` outside of the `http.request` scope is deprecated and will be impossible in version 4.0.',
'Using `%s` outside of the `http-request` scope is deprecated and will be impossible in version 4.0.',
PaginationProviderInterface::class
), $error);
});
Expand Down

0 comments on commit 5e5b1bb

Please sign in to comment.