diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 000000000..ec2f8718d --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,34 @@ +name: "Continuous Integration" + +on: [push] + +env: + fail-fast: true + +jobs: + tests: + name: "Doctrine1 Tests" + runs-on: "ubuntu-22.04" + + strategy: + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + # extensions: "${{ matrix.extension }}" + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + + - name: "Run Tests" + run: "cd tests && php run.php" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cfd880464..000000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -os: linux -dist: focal -language: php - -php: - - 7.4 - - 8.0 - - 8.1 - - nightly - -cache: - directories: - - $HOME/.composer/cache - -jobs: - fast_finish: true - allow_failures: - - php: nightly - - php: 5.3 - include: - - php: 5.3 - dist: precise - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - dist: trusty - - php: 7.0 - dist: xenial - - php: 7.1 - dist: xenial - - php: 7.2 - dist: xenial - - php: 7.3 - dist: xenial - - -services: - - mysql - -before_install: - - mysql -e 'CREATE DATABASE IF NOT EXISTS test;' - -install: - - composer install --prefer-dist --no-progress --no-suggest -o - -script: - - "cd tests && php -dshort_open_tag=Off -dmagic_quotes_gpc=Off run.php" diff --git a/tests/QueryTestCase.php b/tests/QueryTestCase.php index 7c48a32c9..bf349c31b 100644 --- a/tests/QueryTestCase.php +++ b/tests/QueryTestCase.php @@ -307,11 +307,11 @@ public function testParseTableAliasesWithBetweenInWhereClause() $q1 = Doctrine_Query::create() ->select('u.id') ->from('QueryTest_User u') - ->where("CURRENT_DATE() BETWEEN u.QueryTest_Subscription.begin AND u.QueryTest_Subscription.begin") + ->where("now() BETWEEN u.QueryTest_Subscription.begin AND u.QueryTest_Subscription.begin") ->addWhere( 'u.id != 5' ) ; - $expected = 'SELECT q.id AS q__id FROM query_test__user q LEFT JOIN query_test__subscription q2 ON q.subscriptionid = q2.id WHERE (CURRENT_DATE() BETWEEN q2.begin AND q2.begin AND q.id != 5)'; + $expected = 'SELECT q.id AS q__id FROM query_test__user q LEFT JOIN query_test__subscription q2 ON q.subscriptionid = q2.id WHERE (datetime(\'now\') BETWEEN q2.begin AND q2.begin AND q.id != 5)'; $this->assertEqual( $q1->getSqlQuery(), $expected ); diff --git a/tests/Ticket/2355TestCase.php b/tests/Ticket/2355TestCase.php index 47c7616b1..c661703ca 100644 --- a/tests/Ticket/2355TestCase.php +++ b/tests/Ticket/2355TestCase.php @@ -32,6 +32,12 @@ */ class Doctrine_Ticket_2355_TestCase extends Doctrine_UnitTestCase { + public function setUp() + { + Doctrine_Manager::getInstance()->reset(); + parent::setUp(); + } + public function prepareTables() { $this->tables[] = 'News'; diff --git a/tests/bin/test b/tests/bin/test index 20d8d6aee..2df829884 100755 --- a/tests/bin/test +++ b/tests/bin/test @@ -17,7 +17,7 @@ skipPHPVersions='php8' # Commands # dcexec="docker-compose exec -u `id -u`:`id -g`" -composerUpdate='composer update --prefer-dist --no-suggest --optimize-autoloader' +composerUpdate='composer update --prefer-dist --optimize-autoloader' doctrineTestSuite='run.php' # Parse arguments