From a2565e945f2e74c3150611213d0195e2437471bc Mon Sep 17 00:00:00 2001 From: Julien Rosset Date: Fri, 3 Sep 2021 18:57:27 +0200 Subject: [PATCH] Test file and update README --- README.md | 11 +++++++++++ tests/.env | 5 +++++ tests/test.php | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 tests/.env create mode 100644 tests/test.php diff --git a/README.md b/README.md index 50c742a..ca7047d 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,16 @@ composer require jrosset/envreader ```php 'DEV', + 'WEBSITE_NAME' => 'Generic site' + ]; + } +} ``` diff --git a/tests/.env b/tests/.env new file mode 100644 index 0000000..4f45cb5 --- /dev/null +++ b/tests/.env @@ -0,0 +1,5 @@ +WEBSITE_NAME=Foo + +DB_NAME=Bar +DB_LOGIN=Bar +DB_PASS=***** \ No newline at end of file diff --git a/tests/test.php b/tests/test.php new file mode 100644 index 0000000..78b7ed8 --- /dev/null +++ b/tests/test.php @@ -0,0 +1,23 @@ + 'DEV', + 'WEBSITE_NAME' => 'Generic site', + ]; + } +} + +var_dump(Env::getInstance()->getProperties()); +var_dump(Env::getInstance()->getProperty('db_host', 'localhost')); \ No newline at end of file