This paper presents a real-time hardware-in-the-loop (HIL) setup capable of experimentally emulating the coupling between lithium-ion batteries and photovoltaic (PV) cells. The paper is motivated by earlier research showing that certain 'hybrid' battery-PV integration topologies are inherently self-balancing, in the sense that differences in state of charge between battery cells diminish with time without the need for active balancing circuitry. The literature shows this self-balancing property using both theoretical analyses and simulation studies, but there is still a need for experimental demonstrations. Our goal in this paper is to validate this self-balancing property in a hybrid string experimentally. Towards this goal, we construct a HIL setup that physically emulates the voltage-current characteristics of three PV arrays and exposes three series-connected battery cells to these characteristics in real time. The setup uses an ARM microcontroller, together with three DC-DC converters and isolated serial communications, to achieve this emulation. Experiments conducted using this setup show that certain topologies for integrating PV cells with lithium-ion batteries are indeed self-balancing. Moreover, the setup provides the flexibility for exploring and testing other potential integration topologies and operating conditions.