/** * @covers \Box\TestScribe\Utils\Util::appendStringIfNotEmpty * @covers \Box\TestScribe\Utils\Util */ public function testAppendStringIfNotEmpty_non_empty_text() { // Execute the method under test. $executionResult = Util::appendStringIfNotEmpty('a', 'b'); // Validate the execution result. $expected = 'ab'; $this->assertSame($expected, $executionResult, 'Variable ( executionResult ) doesn\'t have the expected value.'); }
/** * Generate statements for setting up the mocks of the objects * injected by the dependency management system. * * @return string */ public function renderObjectInjectionStatements() { $objectInjectionStatements = $this->injectedMockObjectsRenderer->genMockedObjectStatements(); $mockClassInjectionStatements = $this->injectedMockClassesRenderer->genMockedClassesStatements(); $combinedStatements = ArrayUtil::joinNonEmptyStringsWithNewLine([$objectInjectionStatements, $mockClassInjectionStatements], 2); $comment = "// Setup mocks injected by the dependency management system.\n\n"; $result = Util::appendStringIfNotEmpty($comment, $combinedStatements); return $result; }