Skip to content

Commit

Permalink
New tests for MapServer#6907.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdlime committed Feb 20, 2024
1 parent 1962564 commit 4a054e4
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions msautotest/query/6907_01.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG
ENV
MS_MAP_PATTERN "."
MS_EMPTY "http://localhost/6907_01.html"
END
END
32 changes: 32 additions & 0 deletions msautotest/query/6907_01.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Test 1: mode=itemquery - matching record
# RUN_PARMS: 6907_01_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT]
#
# Test 2: mode=itemquery - no matching record
# RUN_PARMS: 6907_01_test002.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
#
# Test 3: mode=itemquery - no matching record, MS_EMPTY in config
# RUN_PARMS: 6907_01_test003.txt [MAPSERV] -conf 6907_01.conf QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
MAP
NAME 'query'
EXTENT 125000 4785000 789000 5489000
UNITS METERS

WEB
QUERYFORMAT 'tmpl'
END

OUTPUTFORMAT
NAME 'tmpl'
DRIVER 'TEMPLATE'
MIMETYPE 'text/html'
FORMATOPTION "FILE=template/6907.tmpl"
END

LAYER
NAME 'bdry_counpy2'
VALIDATION
qstring '^[A-Z]{4}$'
END
INCLUDE 'include/bdry_counpy2_shapefile.map'
END
END
30 changes: 30 additions & 0 deletions msautotest/query/6907_02.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Test 1: mode=itemquery - matching record
# RUN_PARMS: 6907_02_test001.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ANOK&qitem=cty_abbr' > [RESULT]
#
# Test 2: mode=itemquery - no matching record
# RUN_PARMS: 6907_02_test002.txt [MAPSERV] QUERY_STRING='map=[MAPFILE]&mode=itemquery&qlayer=bdry_counpy2&qstring=ABCD&qitem=cty_abbr' > [RESULT]
MAP
NAME 'query'
EXTENT 125000 4785000 789000 5489000
UNITS METERS

WEB
EMPTY 'http://localhost/6907_02.html'
QUERYFORMAT 'tmpl'
END

OUTPUTFORMAT
NAME 'tmpl'
DRIVER 'TEMPLATE'
MIMETYPE 'text/html'
FORMATOPTION "FILE=template/6907.tmpl"
END

LAYER
NAME 'bdry_counpy2'
VALIDATION
qstring '^[A-Z]{4}$'
END
INCLUDE 'include/bdry_counpy2_shapefile.map'
END
END
4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_01_test001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html

Anoka:ANOK

4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_01_test002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html



5 changes: 5 additions & 0 deletions msautotest/query/expected/6907_01_test003.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Status: 302 Found
Uri: http://localhost/6907_01.html
Location: http://localhost/6907_01.html
Content-Type: text/html

4 changes: 4 additions & 0 deletions msautotest/query/expected/6907_02_test001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Content-Type: text/html

Anoka:ANOK

5 changes: 5 additions & 0 deletions msautotest/query/expected/6907_02_test002.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Status: 302 Found
Uri: http://localhost/6907_02.html
Location: http://localhost/6907_02.html
Content-Type: text/html

0 comments on commit 4a054e4

Please sign in to comment.