Skip to content

Commit 6fc0de2

Browse files
committed
bump php-mcp to ^0.2 and fix phpunit notices after phpunit 12.5.x update
1 parent 62f63a2 commit 6fc0de2

File tree

6 files changed

+248
-111
lines changed

6 files changed

+248
-111
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": {
1414
"php": ">=8.2",
1515
"cakephp/cakephp": "^5.2",
16-
"mcp/sdk": "^0.1",
16+
"mcp/sdk": "^0.2",
1717
"ext-sqlite3": "*"
1818
},
1919
"require-dev": {

tests/TestCase/Builder/ServerBuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ public function testBasePathDefaultsToRoot(): void
449449
public function testSetContainer(): void
450450
{
451451
$builder = new ServerBuilder();
452-
$container = $this->getMockBuilder(ContainerInterface::class)->getMock();
452+
$container = $this->createStub(ContainerInterface::class);
453453

454454
$result = $builder->setContainer($container);
455455

@@ -476,7 +476,7 @@ public function testBuilderWithNullContainer(): void
476476
*/
477477
public function testSetLogger(): void
478478
{
479-
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
479+
$logger = $this->createStub(LoggerInterface::class);
480480
$builder = new ServerBuilder();
481481

482482
$result = $builder->setLogger($logger);
@@ -500,7 +500,7 @@ public function testGetLoggerReturnsNull(): void
500500
*/
501501
public function testSetLoggerWithNull(): void
502502
{
503-
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
503+
$logger = $this->createStub(LoggerInterface::class);
504504
$builder = new ServerBuilder();
505505

506506
$builder->setLogger($logger);
@@ -515,7 +515,7 @@ public function testSetLoggerWithNull(): void
515515
*/
516516
public function testBuildWithLogger(): void
517517
{
518-
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
518+
$logger = $this->createStub(LoggerInterface::class);
519519
$config = Configure::read('Synapse');
520520

521521
$builder = (new ServerBuilder($config))->setLogger($logger);

tests/TestCase/Documentation/DocumentProcessorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function testGenerateIdFormat(): void
255255
*/
256256
public function testProcessWithNonExistentFile(): void
257257
{
258-
$repository = $this->createMock(Repository::class);
258+
$repository = $this->createStub(Repository::class);
259259
$repository->method('readFile')->willReturn(null);
260260

261261
$result = $this->DocumentProcessor->process($repository, 'non-existent.md', 'test-source');
@@ -269,7 +269,7 @@ public function testProcessWithNonExistentFile(): void
269269
public function testProcessWithValidFile(): void
270270
{
271271
$content = $this->readTestFile('simple.md');
272-
$repository = $this->createMock(Repository::class);
272+
$repository = $this->createStub(Repository::class);
273273
$repository->method('readFile')->willReturn($content);
274274

275275
$result = $this->DocumentProcessor->process($repository, 'simple.md', 'test-source');
@@ -284,7 +284,7 @@ public function testProcessWithValidFile(): void
284284
*/
285285
public function testProcessBatch(): void
286286
{
287-
$repository = $this->createMock(Repository::class);
287+
$repository = $this->createStub(Repository::class);
288288
$repository->method('readFile')->willReturnMap([
289289
['simple.md', $this->readTestFile('simple.md')],
290290
['with-frontmatter.md', $this->readTestFile('with-frontmatter.md')],
@@ -307,7 +307,7 @@ public function testProcessBatch(): void
307307
*/
308308
public function testProcessBatchEmpty(): void
309309
{
310-
$repository = $this->createMock(Repository::class);
310+
$repository = $this->createStub(Repository::class);
311311
$results = $this->DocumentProcessor->processBatch($repository, [], 'test-source');
312312

313313
$this->assertEmpty($results);

tests/TestCase/Documentation/DocumentSearchServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function testConstructorCreatesDirectoryIfNeeded(): void
132132
*/
133133
public function testConstructorWithCustomRepositoryManager(): void
134134
{
135-
$mockManager = $this->createMock(RepositoryManager::class);
135+
$mockManager = $this->createStub(RepositoryManager::class);
136136

137137
$service = new DocumentSearchService(
138138
databasePath: $this->testDbPath,
@@ -147,7 +147,7 @@ public function testConstructorWithCustomRepositoryManager(): void
147147
*/
148148
public function testConstructorWithCustomDocumentProcessor(): void
149149
{
150-
$mockProcessor = $this->createMock(DocumentProcessor::class);
150+
$mockProcessor = $this->createStub(DocumentProcessor::class);
151151

152152
$service = new DocumentSearchService(
153153
databasePath: $this->testDbPath,

0 commit comments

Comments
 (0)