createMock(Filesystem::class); $filesystem ->method('exists') ->with('./composer.json') ->willReturn(true); $action = new DetermineProjectLanguage( filesystem: $filesystem, ); self::assertSame( actual: $action->getLanguage(), expected: ProjectLanguage::PHP->value, ); } /** * @test * @testdox It identifies a node project if it has a package.json file */ public function it_identifies_a_node_project_if_it_has_a_package_json_file(): void { // self::markTestSkipped(); $filesystem = $this->createMock(Filesystem::class); $filesystem ->method('exists') ->will(self::returnValueMap([ ['./composer.json', false], ['./package.json', true], ])); $action = new DetermineProjectLanguage( filesystem: $filesystem, ); self::assertSame( actual: $action->getLanguage(), expected: ProjectLanguage::JavaScript->value, ); } }