assertSame('', thold_build_cdef(1, '', 4, 5)); } /** * @return void */ public function testEvaluatesALiteralAdditionCdef(): void { CactiStubs::willReturn('db_fetch_assoc_prepared', [ ['id' => 1, 'type' => 6, 'value' => 10], ['id' => 2, 'type' => 6, 'value' => 5], ['id' => 3, 'type' => 2, 'value' => 1], ]); $this->assertSame(15, thold_build_cdef(1, 100, 4, 5)); } /** * @return void */ public function testFailsClosedWhenAQueryOperandDoesNotResolve(): void { CactiStubs::willReturn('db_fetch_assoc_prepared', [ ['id' => 1, 'type' => 6, 'value' => 10], ['id' => 2, 'type' => 6, 'value' => '|query_ifOperStatus|'], ['id' => 3, 'type' => 2, 'value' => 1], ]); CactiStubs::willReturn('db_fetch_cell_prepared', ''); $this->assertSame('', thold_build_cdef(1, 100, 4, 5)); } /** * @return void */ public function testEvaluatesWhenAQueryOperandResolves(): void { CactiStubs::willReturn('db_fetch_assoc_prepared', [ ['id' => 1, 'type' => 6, 'value' => 10], ['id' => 2, 'type' => 6, 'value' => '|query_ifOperStatus|'], ['id' => 3, 'type' => 2, 'value' => 1], ]); CactiStubs::willReturn('db_fetch_cell_prepared', 5); $this->assertSame(15, thold_build_cdef(1, 100, 4, 5)); } }