Update analyze function to check STATUS_WORD

The STATUS_WORD PMBus command response will be the start of the power
supply fault analysis. Update the analyze() function to read its value
and process (select) fault bits.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: If7274ad237c0604a56008676ae64804a5fd2854e
diff --git a/phosphor-power-supply/test/mock.hpp b/phosphor-power-supply/test/mock.hpp
new file mode 100644
index 0000000..0c64e00
--- /dev/null
+++ b/phosphor-power-supply/test/mock.hpp
@@ -0,0 +1,55 @@
+#pragma once
+
+#include "pmbus.hpp"
+#include "util_base.hpp"
+
+#include <gmock/gmock.h>
+
+namespace phosphor
+{
+namespace pmbus
+{
+class MockedPMBus : public PMBusBase
+{
+
+  public:
+    virtual ~MockedPMBus() = default;
+
+    MOCK_METHOD(uint64_t, read, (const std::string& name, Type type),
+                (override));
+};
+} // namespace pmbus
+
+namespace power
+{
+namespace psu
+{
+class MockedUtil : public UtilBase
+{
+  public:
+    virtual ~MockedUtil() = default;
+
+    MOCK_METHOD(bool, getPresence,
+                (sdbusplus::bus::bus & bus, const std::string& invpath),
+                (const, override));
+};
+
+static std::unique_ptr<MockedUtil> util;
+inline const UtilBase& getUtils()
+{
+    if (!util)
+    {
+        util = std::make_unique<MockedUtil>();
+    }
+    return *util;
+}
+
+inline void freeUtils()
+{
+    util.reset();
+}
+
+} // namespace psu
+} // namespace power
+
+} // namespace phosphor