diff --git a/tests/functions/fixtures/style_select.xml b/tests/functions/fixtures/style_select.xml
new file mode 100644
index 0000000000..12d6392ab5
--- /dev/null
+++ b/tests/functions/fixtures/style_select.xml
@@ -0,0 +1,23 @@
+
+
+
+ style_id
+ style_name
+ style_active
+
+ 1
+ prosilver
+ 1
+
+
+ 2
+ subsilver2
+ 1
+
+
+ 3
+ zoo
+ 0
+
+
+
diff --git a/tests/functions/style_select_test.php b/tests/functions/style_select_test.php
new file mode 100644
index 0000000000..1e44f3c2cb
--- /dev/null
+++ b/tests/functions/style_select_test.php
@@ -0,0 +1,41 @@
+createXMLDataSet(dirname(__FILE__).'/fixtures/style_select.xml');
+ }
+
+ static public function style_select_data()
+ {
+ return array(
+ array('', false, ''),
+ array('', true, ''),
+ array('1', false, ''),
+ array('1', true, ''),
+ array('3', false, ''),
+ array('3', true, ''),
+ );
+ }
+
+ /**
+ * @dataProvider style_select_data
+ */
+ public function test_style_select($default, $all, $expected)
+ {
+ global $db;
+ $db = $this->new_dbal();
+
+ $this->assertEquals($expected, style_select($default, $all));
+ }
+}