From 24d746dd126e64d798c850420ce78875349fdf6c Mon Sep 17 00:00:00 2001 From: Iveta Cesalova Date: Fri, 19 Mar 2021 09:06:02 +0100 Subject: [PATCH] add test strtotime-parse-dates --- .../strtotime-parse-dates/TC#0068513.fmf | 15 ++++++ integration/strtotime-parse-dates/main.fmf | 25 +++++++++ integration/strtotime-parse-dates/runtest.sh | 53 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 integration/strtotime-parse-dates/TC#0068513.fmf create mode 100644 integration/strtotime-parse-dates/main.fmf create mode 100755 integration/strtotime-parse-dates/runtest.sh diff --git a/integration/strtotime-parse-dates/TC#0068513.fmf b/integration/strtotime-parse-dates/TC#0068513.fmf new file mode 100644 index 0000000..aec544d --- /dev/null +++ b/integration/strtotime-parse-dates/TC#0068513.fmf @@ -0,0 +1,15 @@ +contact: None +component: +- php +tag: +- NoModularTier +- NoRHEL3 +- NoRHEL4 +- TIPpass_Apps +- Tier2 +relevancy: | + distro = rhel-3, rhel-4: False +extra-nitrate: TC#0068513 +extra-summary: /CoreOS/php/Regression/bz444425-strtotime +extra-pepa: | + PACKAGES='php-cli' component/php diff --git a/integration/strtotime-parse-dates/main.fmf b/integration/strtotime-parse-dates/main.fmf new file mode 100644 index 0000000..c58495c --- /dev/null +++ b/integration/strtotime-parse-dates/main.fmf @@ -0,0 +1,25 @@ +summary: PHP bug 37514 strtotime to parse dates with out specifying a year +description: | + Test Name: bz444425-strtotime - Bugzilla(s) 444425 + Author: Martin Koci (koca) + Location: /CoreOS/php/Regression/bz444425-strtotime + + Short Description: PHP bug 37514 strtotime to parse dates with out specifying a year + + + Long Description: + + When using strtotime to parse dates if an 'am' or 'pm' is added without specifying a year, dates returned are not proper +contact: +- Iveta Cesalova +component: +- php +test: ./runtest.sh +framework: beakerlib +recommend: +- php +duration: 5m +enabled: true +tier: '2' +extra-summary: /CoreOS/php/Regression/bz444425-strtotime +extra-task: /CoreOS/php/Regression/bz444425-strtotime diff --git a/integration/strtotime-parse-dates/runtest.sh b/integration/strtotime-parse-dates/runtest.sh new file mode 100755 index 0000000..ebacc25 --- /dev/null +++ b/integration/strtotime-parse-dates/runtest.sh @@ -0,0 +1,53 @@ +# runtest.sh - bz444425-strtotime - Bugzilla(s) 444425 +# Author: Martin Koci (koca) +# Location: /CoreOS/php/Regression/bz444425-strtotime/runtest.sh + +# Description: PHP bug 37514 strtotime to parse dates with out specifying a year + +# Copyright (c) 2008 Red Hat, Inc. All rights reserved. This copyrighted material +# is made available to anyone wishing to use, modify, copy, or +# redistribute it subject to the terms and conditions of the GNU General +# Public License v.2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +PACKAGES="${PACKAGES:-php-cli}" + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlStartJournal + +###################### +# Prepare environment +###################### +rlPhaseStartSetup Preparation + rlAssertRpm --all + rlAssertBinaryOrigin "php" + rlRun "php -v" +rlPhaseEnd + +###################### +# Begin Test-Case +###################### +rlPhaseStartTest Test + rlRun "php -r 'echo date(\"r\", strtotime(\"May 18th 5:05pm\"));'|egrep '1969|1970'" 1 + rlRun "php -r 'echo date(\"r\", strtotime(\"May 18th 5:05 pm\"));'|egrep '1969|1970'" 1 +rlPhaseEnd + +###################### +# Clean after the test +###################### +rlPhaseStartCleanup Clean-Up +#rlBundleLogs logs file.log another-file.log +rlCreateLogFromJournal > ${OUTPUTFILE} +rlPhaseEnd + +