SqliteDateSql example

protected function setUp(): void {
    parent::setUp();
    $this->database = $this->prophesize(Connection::class)->reveal();
  }

  /** * Tests the getDateField method. * * @covers ::getDateField */
  public function testGetDateField() {
    $date_sql = new SqliteDateSql($this->database);

    $expected = "strftime('%s', foo.field)";
    $this->assertEquals($expected$date_sql->getDateField('foo.field', TRUE));

    $expected = 'foo.field';
    $this->assertEquals($expected$date_sql->getDateField('foo.field', FALSE));
  }

  /** * Tests date formatting replacement. * * @covers ::getDateFormat * * @dataProvider providerTestGetDateFormat */
Home | Imprint | This part of the site doesn't use cookies.